logger-36 2025.12__py3-none-any.whl → 2025.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- logger_36/catalog/handler/console.py +16 -38
- logger_36/catalog/handler/console_rich.py +49 -81
- logger_36/catalog/handler/file.py +18 -44
- logger_36/catalog/handler/generic.py +41 -62
- logger_36/catalog/logger/gpu.py +1 -1
- logger_36/catalog/logger/system.py +1 -1
- logger_36/extension/exception.py +4 -2
- logger_36/{api/handler.py → extension/line.py} +31 -6
- logger_36/task/format/memory.py +1 -5
- logger_36/task/format/rule.py +1 -1
- logger_36/task/inspection.py +1 -1
- logger_36/task/storage.py +1 -1
- logger_36/type/handler.py +84 -104
- logger_36/type/logger.py +55 -37
- logger_36/type/message.py +121 -0
- logger_36/version.py +1 -1
- {logger_36-2025.12.dist-info → logger_36-2025.13.dist-info}/METADATA +2 -2
- {logger_36-2025.12.dist-info → logger_36-2025.13.dist-info}/RECORD +20 -20
- {logger_36-2025.12.dist-info → logger_36-2025.13.dist-info}/WHEEL +1 -1
- logger_36/task/handling.py +0 -196
- {logger_36-2025.12.dist-info → logger_36-2025.13.dist-info}/top_level.txt +0 -0
@@ -4,61 +4,39 @@ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
|
|
4
4
|
SEE COPYRIGHT NOTICE BELOW
|
5
5
|
"""
|
6
6
|
|
7
|
-
import dataclasses as d
|
8
7
|
import logging as l
|
9
8
|
import sys as s
|
10
9
|
import typing as h
|
11
10
|
|
12
11
|
from logger_36.constant.record import SHOW_W_RULE_ATTR
|
13
12
|
from logger_36.task.format.rule import RuleAsText
|
14
|
-
from logger_36.type.handler import
|
13
|
+
from logger_36.type.handler import handler_t as base_t
|
15
14
|
|
16
15
|
|
17
|
-
|
18
|
-
class console_handler_t(l.Handler):
|
19
|
-
"""
|
20
|
-
kind: See logger_36.constant.handler.handler_codes_h.
|
21
|
-
"""
|
22
|
-
|
16
|
+
class console_handler_t(base_t):
|
23
17
|
kind: h.ClassVar[str] = "c"
|
24
18
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
level: int,
|
38
|
-
should_store_memory_usage: bool,
|
39
|
-
message_width: int,
|
40
|
-
formatter: l.Formatter | None,
|
41
|
-
) -> None:
|
19
|
+
@classmethod
|
20
|
+
def New(
|
21
|
+
cls,
|
22
|
+
/,
|
23
|
+
*,
|
24
|
+
name: str | None = None,
|
25
|
+
should_store_memory_usage: bool = False,
|
26
|
+
message_width: int = -1,
|
27
|
+
level: int = l.NOTSET,
|
28
|
+
formatter: l.Formatter | None = None,
|
29
|
+
**unused,
|
30
|
+
) -> h.Self:
|
42
31
|
""""""
|
43
|
-
|
44
|
-
|
45
|
-
self.extension = handler_extension_t(
|
46
|
-
name=name,
|
47
|
-
should_store_memory_usage=should_store_memory_usage,
|
48
|
-
handler=self,
|
49
|
-
level=level,
|
50
|
-
message_width=message_width,
|
51
|
-
formatter=formatter,
|
52
|
-
)
|
53
|
-
|
54
|
-
self.MessageFromRecord = self.extension.MessageFromRecord
|
32
|
+
return cls(name, should_store_memory_usage, message_width, level, formatter)
|
55
33
|
|
56
34
|
def emit(self, record: l.LogRecord, /) -> None:
|
57
35
|
""""""
|
58
36
|
if hasattr(record, SHOW_W_RULE_ATTR):
|
59
37
|
message = RuleAsText(record.msg)
|
60
38
|
else:
|
61
|
-
message = self.MessageFromRecord(record)
|
39
|
+
message = self.MessageFromRecord(record, line_width=self.message_width)
|
62
40
|
s.__stdout__.write(message + "\n")
|
63
41
|
|
64
42
|
def LogAsIs(self, message: str, /) -> None:
|
@@ -4,10 +4,15 @@ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
|
|
4
4
|
SEE COPYRIGHT NOTICE BELOW
|
5
5
|
"""
|
6
6
|
|
7
|
-
import dataclasses as d
|
8
7
|
import logging as l
|
9
8
|
import typing as h
|
10
9
|
|
10
|
+
from rich.console import Console as console_t # noqa
|
11
|
+
from rich.console import RenderableType as renderable_t # noqa
|
12
|
+
from rich.markup import escape as EscapedVersion # noqa
|
13
|
+
from rich.text import Text as text_t # noqa
|
14
|
+
from rich.traceback import install as InstallTracebackHandler # noqa
|
15
|
+
|
11
16
|
from logger_36.catalog.config.console_rich import (
|
12
17
|
ACTUAL_COLOR,
|
13
18
|
ALTERNATIVE_BACKGROUND_FOR_DARK,
|
@@ -22,12 +27,7 @@ from logger_36.config.message import ACTUAL_PATTERNS, EXPECTED_PATTERNS, WHERE_S
|
|
22
27
|
from logger_36.constant.message import CONTEXT_LENGTH
|
23
28
|
from logger_36.constant.record import SHOW_W_RULE_ATTR
|
24
29
|
from logger_36.task.format.rule import Rule
|
25
|
-
from logger_36.type.handler import
|
26
|
-
from rich.console import Console as console_t # noqa
|
27
|
-
from rich.console import RenderableType as renderable_t # noqa
|
28
|
-
from rich.markup import escape as EscapedVersion # noqa
|
29
|
-
from rich.text import Text as text_t # noqa
|
30
|
-
from rich.traceback import install as InstallTracebackHandler # noqa
|
30
|
+
from logger_36.type.handler import handler_t as base_t
|
31
31
|
|
32
32
|
_COMMON_TRACEBACK_ARGUMENTS = ("theme", "width")
|
33
33
|
_EXCLUSIVE_TRACEBACK_ARGUMENTS = (
|
@@ -37,17 +37,14 @@ _EXCLUSIVE_TRACEBACK_ARGUMENTS = (
|
|
37
37
|
"locals_hide_sunder",
|
38
38
|
"locals_max_length",
|
39
39
|
"locals_max_string",
|
40
|
-
"
|
40
|
+
"max_framesshow_locals",
|
41
41
|
"suppress",
|
42
42
|
"word_wrap",
|
43
43
|
)
|
44
44
|
|
45
45
|
|
46
|
-
|
47
|
-
class console_rich_handler_t(l.Handler):
|
46
|
+
class console_rich_handler_t(base_t):
|
48
47
|
"""
|
49
|
-
kind: See logger_36.constant.handler.handler_codes_h.
|
50
|
-
|
51
48
|
alternating_logs:
|
52
49
|
- 0: disabled
|
53
50
|
- 1: enabled for dark background
|
@@ -56,87 +53,58 @@ class console_rich_handler_t(l.Handler):
|
|
56
53
|
|
57
54
|
kind: h.ClassVar[str] = "c"
|
58
55
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
extension: handler_extension_t = d.field(init=False)
|
72
|
-
console: console_t = d.field(init=False)
|
73
|
-
MessageFromRecord: MessageFromRecordPreprocessed_p = d.field(init=False)
|
74
|
-
log_parity: bool = d.field(init=False, default=False)
|
75
|
-
|
76
|
-
@property
|
77
|
-
def past_logs_as_HTML(self) -> str | None:
|
56
|
+
@classmethod
|
57
|
+
def New(
|
58
|
+
cls,
|
59
|
+
/,
|
60
|
+
*,
|
61
|
+
name: str | None = None,
|
62
|
+
should_store_memory_usage: bool = False,
|
63
|
+
message_width: int = -1,
|
64
|
+
level: int = l.NOTSET,
|
65
|
+
formatter: l.Formatter | None = None,
|
66
|
+
**kwargs,
|
67
|
+
) -> h.Self:
|
78
68
|
""""""
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
) -> None:
|
69
|
+
alternating_logs = kwargs.pop("alternating_logs", 0)
|
70
|
+
should_install_traceback = kwargs.pop("should_install_traceback", False)
|
71
|
+
|
72
|
+
assert alternating_logs in (0, 1, 2)
|
73
|
+
|
74
|
+
output = cls(name, should_store_memory_usage, message_width, level, formatter)
|
75
|
+
|
76
|
+
output.console = None # console_t | None.
|
77
|
+
output.alternating_logs = alternating_logs
|
78
|
+
output.log_parity = False
|
79
|
+
|
80
|
+
output.__post_init_local__(should_install_traceback, **kwargs)
|
81
|
+
|
82
|
+
return output
|
83
|
+
|
84
|
+
def __post_init_local__(self, should_install_traceback: bool, **kwargs) -> None:
|
96
85
|
""""""
|
97
|
-
|
98
|
-
|
99
|
-
self.extension = handler_extension_t(
|
100
|
-
name=name,
|
101
|
-
should_store_memory_usage=should_store_memory_usage,
|
102
|
-
handler=self,
|
103
|
-
level=level,
|
104
|
-
message_width=message_width,
|
105
|
-
formatter=formatter,
|
106
|
-
)
|
107
|
-
|
108
|
-
if rich_kwargs is None:
|
109
|
-
rich_console_kwargs = {}
|
110
|
-
else:
|
111
|
-
rich_console_kwargs = rich_kwargs
|
112
|
-
rich_traceback_kwargs = {}
|
86
|
+
traceback_kwargs = {}
|
113
87
|
if should_install_traceback:
|
114
|
-
for key in
|
88
|
+
for key in kwargs:
|
115
89
|
if key in _COMMON_TRACEBACK_ARGUMENTS:
|
116
|
-
|
90
|
+
traceback_kwargs[key] = kwargs[key]
|
117
91
|
elif key in _EXCLUSIVE_TRACEBACK_ARGUMENTS:
|
118
|
-
|
119
|
-
del rich_console_kwargs[key]
|
120
|
-
|
121
|
-
self.console = console_t(
|
122
|
-
highlight=False,
|
123
|
-
force_terminal=True,
|
124
|
-
record=should_record,
|
125
|
-
**rich_console_kwargs,
|
126
|
-
)
|
127
|
-
if should_install_traceback:
|
128
|
-
rich_traceback_kwargs["console"] = self.console
|
129
|
-
InstallTracebackHandler(**rich_traceback_kwargs)
|
92
|
+
traceback_kwargs[key] = kwargs.pop(key)
|
130
93
|
|
131
|
-
self.
|
132
|
-
|
94
|
+
self.console = console_t(highlight=False, force_terminal=True, **kwargs)
|
95
|
+
|
96
|
+
if should_install_traceback:
|
97
|
+
traceback_kwargs["console"] = self.console
|
98
|
+
InstallTracebackHandler(**traceback_kwargs)
|
133
99
|
|
134
100
|
def emit(self, record: l.LogRecord, /) -> None:
|
135
101
|
""""""
|
136
102
|
if hasattr(record, SHOW_W_RULE_ATTR):
|
137
103
|
richer = Rule(record.msg, DATE_TIME_COLOR)
|
138
104
|
else:
|
139
|
-
message = self.MessageFromRecord(
|
105
|
+
message = self.MessageFromRecord(
|
106
|
+
record, line_width=self.message_width, PreProcessed=EscapedVersion
|
107
|
+
)
|
140
108
|
richer = HighlightedVersion(
|
141
109
|
self.console,
|
142
110
|
message,
|
@@ -4,68 +4,42 @@ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
|
|
4
4
|
SEE COPYRIGHT NOTICE BELOW
|
5
5
|
"""
|
6
6
|
|
7
|
-
import dataclasses as d
|
8
7
|
import logging as l
|
9
8
|
import typing as h
|
10
9
|
from pathlib import Path as path_t
|
11
10
|
|
12
11
|
from logger_36.constant.record import SHOW_W_RULE_ATTR
|
13
12
|
from logger_36.task.format.rule import RuleAsText
|
14
|
-
from logger_36.type.handler import
|
13
|
+
from logger_36.type.handler import file_handler_t as base_t
|
15
14
|
|
16
15
|
|
17
|
-
|
18
|
-
class file_handler_t(l.FileHandler):
|
19
|
-
"""
|
20
|
-
kind: See logger_36.constant.handler.handler_codes_h.
|
21
|
-
"""
|
22
|
-
|
16
|
+
class file_handler_t(base_t):
|
23
17
|
kind: h.ClassVar[str] = "f"
|
24
18
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
def __post_init__(
|
39
|
-
self,
|
40
|
-
name: str | None,
|
41
|
-
level: int,
|
42
|
-
should_store_memory_usage: bool,
|
43
|
-
message_width: int,
|
44
|
-
formatter: l.Formatter | None,
|
45
|
-
path: path_t | None,
|
46
|
-
handler_args: tuple[h.Any, ...] | None,
|
47
|
-
handler_kwargs: dict[str, h.Any] | None,
|
48
|
-
) -> None:
|
19
|
+
@classmethod
|
20
|
+
def New(
|
21
|
+
cls,
|
22
|
+
/,
|
23
|
+
*,
|
24
|
+
name: str | None = None,
|
25
|
+
should_store_memory_usage: bool = False,
|
26
|
+
message_width: int = -1,
|
27
|
+
level: int = l.NOTSET,
|
28
|
+
formatter: l.Formatter | None = None,
|
29
|
+
path: str | path_t | None = None,
|
30
|
+
**unused,
|
31
|
+
) -> h.Self:
|
49
32
|
""""""
|
50
|
-
|
51
|
-
|
52
|
-
self.extension = handler_extension_t(
|
53
|
-
name=name,
|
54
|
-
should_store_memory_usage=should_store_memory_usage,
|
55
|
-
handler=self,
|
56
|
-
level=level,
|
57
|
-
message_width=message_width,
|
58
|
-
formatter=formatter,
|
33
|
+
return cls(
|
34
|
+
name, should_store_memory_usage, message_width, level, formatter, path
|
59
35
|
)
|
60
36
|
|
61
|
-
self.MessageFromRecord = self.extension.MessageFromRecord
|
62
|
-
|
63
37
|
def emit(self, record: l.LogRecord, /) -> None:
|
64
38
|
""""""
|
65
39
|
if hasattr(record, SHOW_W_RULE_ATTR):
|
66
40
|
message = RuleAsText(record.msg)
|
67
41
|
else:
|
68
|
-
message = self.MessageFromRecord(record)
|
42
|
+
message = self.MessageFromRecord(record, line_width=self.message_width)
|
69
43
|
self.stream.write(message + "\n")
|
70
44
|
self.stream.flush()
|
71
45
|
|
@@ -4,19 +4,19 @@ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
|
|
4
4
|
SEE COPYRIGHT NOTICE BELOW
|
5
5
|
"""
|
6
6
|
|
7
|
-
import dataclasses as d
|
8
7
|
import logging as l
|
9
8
|
import typing as h
|
10
9
|
|
11
10
|
from logger_36.catalog.config.optional import RICH_IS_AVAILABLE
|
12
11
|
|
13
12
|
if RICH_IS_AVAILABLE:
|
14
|
-
from logger_36.catalog.config.console_rich import DATE_TIME_COLOR
|
15
|
-
from logger_36.catalog.handler.console_rich import HighlightedVersion
|
16
13
|
from rich.console import Console as console_t # noqa
|
17
14
|
from rich.console import ConsoleOptions as console_options_t # noqa
|
18
15
|
from rich.markup import escape as EscapedForRich # noqa
|
19
16
|
from rich.terminal_theme import DEFAULT_TERMINAL_THEME # noqa
|
17
|
+
|
18
|
+
from logger_36.catalog.config.console_rich import DATE_TIME_COLOR
|
19
|
+
from logger_36.catalog.handler.console_rich import HighlightedVersion
|
20
20
|
else:
|
21
21
|
DATE_TIME_COLOR = HighlightedVersion = console_t = console_options_t = (
|
22
22
|
EscapedForRich
|
@@ -24,7 +24,7 @@ else:
|
|
24
24
|
|
25
25
|
from logger_36.constant.record import SHOW_W_RULE_ATTR
|
26
26
|
from logger_36.task.format.rule import Rule, RuleAsText
|
27
|
-
from logger_36.type.handler import
|
27
|
+
from logger_36.type.handler import handler_t as base_t
|
28
28
|
|
29
29
|
LogAsIs_h = h.Callable[[str | h.Any], None]
|
30
30
|
|
@@ -34,11 +34,8 @@ class DisplayRule_p(h.Protocol):
|
|
34
34
|
def __call__(self, /, *, text: str | None = None, color: str = "white") -> None: ...
|
35
35
|
|
36
36
|
|
37
|
-
|
38
|
-
class generic_handler_t(l.Handler):
|
37
|
+
class generic_handler_t(base_t):
|
39
38
|
"""
|
40
|
-
kind: See logger_36.constant.handler.handler_codes_h.
|
41
|
-
|
42
39
|
alternating_logs:
|
43
40
|
- 0: disabled
|
44
41
|
- 1: enabled for dark background
|
@@ -57,59 +54,42 @@ class generic_handler_t(l.Handler):
|
|
57
54
|
|
58
55
|
kind: h.ClassVar[str] = "g"
|
59
56
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
level: d.InitVar[int] = l.NOTSET
|
73
|
-
should_store_memory_usage: d.InitVar[bool] = False
|
74
|
-
message_width: d.InitVar[int] = -1
|
75
|
-
formatter: d.InitVar[l.Formatter | None] = None
|
76
|
-
#
|
77
|
-
supports_html: d.InitVar[bool] = False
|
78
|
-
should_record: d.InitVar[bool] = False
|
79
|
-
rich_kwargs: d.InitVar[dict[str, h.Any] | None] = None
|
80
|
-
|
81
|
-
def __post_init__(
|
82
|
-
self,
|
83
|
-
name: str | None,
|
84
|
-
level: int,
|
85
|
-
should_store_memory_usage: bool,
|
86
|
-
message_width: int,
|
87
|
-
formatter: l.Formatter | None,
|
88
|
-
supports_html: bool,
|
89
|
-
should_record: bool,
|
90
|
-
rich_kwargs: dict[str, h.Any] | None,
|
91
|
-
) -> None:
|
57
|
+
@classmethod
|
58
|
+
def New(
|
59
|
+
cls,
|
60
|
+
/,
|
61
|
+
*,
|
62
|
+
name: str | None = None,
|
63
|
+
should_store_memory_usage: bool = False,
|
64
|
+
message_width: int = -1,
|
65
|
+
level: int = l.NOTSET,
|
66
|
+
formatter: l.Formatter | None = None,
|
67
|
+
**kwargs,
|
68
|
+
) -> h.Self:
|
92
69
|
""""""
|
93
|
-
|
70
|
+
alternating_logs = kwargs.pop("alternating_logs", 0)
|
71
|
+
LogAsIs = kwargs.pop("LogAsIs", lambda _, indented=False: print(_))
|
72
|
+
supports_html = kwargs.pop("supports_html", False)
|
73
|
+
|
74
|
+
assert alternating_logs in (0, 1, 2)
|
94
75
|
|
95
|
-
|
96
|
-
name=name,
|
97
|
-
should_store_memory_usage=should_store_memory_usage,
|
98
|
-
handler=self,
|
99
|
-
level=level,
|
100
|
-
message_width=message_width,
|
101
|
-
formatter=formatter,
|
102
|
-
)
|
76
|
+
output = cls(name, should_store_memory_usage, message_width, level, formatter)
|
103
77
|
|
78
|
+
output.LogAsIs = LogAsIs
|
79
|
+
output.console = None # console_t | None.
|
80
|
+
output.console_options = None # console_options_t | None.
|
81
|
+
output.alternating_logs = alternating_logs
|
82
|
+
output.log_parity = False
|
83
|
+
output.DisplayRule = None # DisplayRule_p | None.
|
84
|
+
|
85
|
+
output.__post_init_local__(supports_html)
|
86
|
+
|
87
|
+
return output
|
88
|
+
|
89
|
+
def __post_init_local__(self, supports_html: bool) -> None:
|
90
|
+
""""""
|
104
91
|
if supports_html and (console_t is not None):
|
105
|
-
|
106
|
-
rich_kwargs = {}
|
107
|
-
self.console = console_t(
|
108
|
-
highlight=False,
|
109
|
-
force_terminal=True,
|
110
|
-
record=should_record,
|
111
|
-
**rich_kwargs,
|
112
|
-
)
|
92
|
+
self.console = console_t(highlight=False, force_terminal=True)
|
113
93
|
self.console_options = self.console.options.update(
|
114
94
|
overflow="ignore", no_wrap=True
|
115
95
|
)
|
@@ -117,21 +97,20 @@ class generic_handler_t(l.Handler):
|
|
117
97
|
else:
|
118
98
|
self.DisplayRule = self._DisplayRuleAsText
|
119
99
|
|
120
|
-
self.MessageFromRecord = self.extension.MessageFromRecord
|
121
|
-
assert self.alternating_logs in (0, 1, 2)
|
122
|
-
|
123
100
|
def emit(self, record: l.LogRecord, /) -> None:
|
124
101
|
""""""
|
125
102
|
if self.console is None:
|
126
103
|
if hasattr(record, SHOW_W_RULE_ATTR):
|
127
104
|
message = RuleAsText(record.msg)
|
128
105
|
else:
|
129
|
-
message = self.MessageFromRecord(record)
|
106
|
+
message = self.MessageFromRecord(record, line_width=self.message_width)
|
130
107
|
else:
|
131
108
|
if hasattr(record, SHOW_W_RULE_ATTR):
|
132
109
|
richer = Rule(record.msg, DATE_TIME_COLOR)
|
133
110
|
else:
|
134
|
-
message = self.MessageFromRecord(
|
111
|
+
message = self.MessageFromRecord(
|
112
|
+
record, line_width=self.message_width, PreProcessed=EscapedForRich
|
113
|
+
)
|
135
114
|
richer = HighlightedVersion(
|
136
115
|
self.console,
|
137
116
|
message,
|
logger_36/catalog/logger/gpu.py
CHANGED
@@ -39,7 +39,7 @@ def LogGPURelatedDetails(*, logger: logger_t = L) -> None:
|
|
39
39
|
f" CuDNN: {system_details['cudnn_version']}\n"
|
40
40
|
f" Tensorflow: {tsfl.version.VERSION}\n"
|
41
41
|
f" Tensorflow Build: {tsfl.sysconfig.get_build_info()}\n"
|
42
|
-
f" TensorRT: {tsrt.__version__}"
|
42
|
+
f" TensorRT: {tsrt.__version__}"
|
43
43
|
)
|
44
44
|
|
45
45
|
|
logger_36/extension/exception.py
CHANGED
@@ -79,7 +79,9 @@ def _HandleException(
|
|
79
79
|
variables = map(
|
80
80
|
lambda _: f"{_:{longest}} = {all_variables[_]}", sorted(found_names)
|
81
81
|
)
|
82
|
-
variables =
|
82
|
+
variables = (
|
83
|
+
2 * _INDENTATION + f"\n{2 * _INDENTATION}".join(variables) + "\n"
|
84
|
+
)
|
83
85
|
else:
|
84
86
|
variables = ""
|
85
87
|
|
@@ -103,7 +105,7 @@ def _HandleException(
|
|
103
105
|
f"{variables}"
|
104
106
|
f"{message}"
|
105
107
|
f"{_INDENTATION}{REPORT_COLOR}Full report at: file://{document.name}"
|
106
|
-
f"{MONOCHROME}{OPTIONAL_NEWLINE}"
|
108
|
+
f"{MONOCHROME}{OPTIONAL_NEWLINE}"
|
107
109
|
)
|
108
110
|
|
109
111
|
lines = tcbk.format_exception(exception)
|
@@ -4,12 +4,37 @@ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
|
|
4
4
|
SEE COPYRIGHT NOTICE BELOW
|
5
5
|
"""
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
|
8
|
+
def WrappedLines(lines: list[str], message_width: int, /) -> list[str]:
|
9
|
+
""""""
|
10
|
+
output = []
|
11
|
+
|
12
|
+
for line in lines:
|
13
|
+
while line.__len__() > message_width:
|
14
|
+
if all(
|
15
|
+
_elm != " " for _elm in line[(message_width - 1) : (message_width + 1)]
|
16
|
+
):
|
17
|
+
if line[message_width - 2] == " ":
|
18
|
+
piece, line = (
|
19
|
+
line[: (message_width - 2)].rstrip(),
|
20
|
+
line[(message_width - 1) :],
|
21
|
+
)
|
22
|
+
else:
|
23
|
+
piece, line = (
|
24
|
+
line[: (message_width - 1)] + "-",
|
25
|
+
line[(message_width - 1) :],
|
26
|
+
)
|
27
|
+
else:
|
28
|
+
piece, line = (
|
29
|
+
line[:message_width].rstrip(),
|
30
|
+
line[message_width:].lstrip(),
|
31
|
+
)
|
32
|
+
output.append(piece)
|
33
|
+
|
34
|
+
output.append(line)
|
35
|
+
|
36
|
+
return output
|
37
|
+
|
13
38
|
|
14
39
|
"""
|
15
40
|
COPYRIGHT NOTICE
|
logger_36/task/format/memory.py
CHANGED
@@ -16,11 +16,7 @@ _BLOCK_FULL = "▉"
|
|
16
16
|
|
17
17
|
|
18
18
|
def FormattedUsage(
|
19
|
-
usage: int,
|
20
|
-
/,
|
21
|
-
*,
|
22
|
-
unit: storage_units_h | None = "a",
|
23
|
-
decimals: int | None = None,
|
19
|
+
usage: int, /, *, unit: storage_units_h | None = "a", decimals: int | None = None
|
24
20
|
) -> tuple[int | float, str]:
|
25
21
|
"""
|
26
22
|
unit: b or None=bytes, k=kilo, m=mega, g=giga, a=auto
|
logger_36/task/format/rule.py
CHANGED
logger_36/task/inspection.py
CHANGED
@@ -51,7 +51,7 @@ def Modules(
|
|
51
51
|
|
52
52
|
if formatted:
|
53
53
|
max_length += 4
|
54
|
-
AlignedInColumns = lambda
|
54
|
+
AlignedInColumns = lambda _: f"{_:{max_length}}" if _ != "\n" else "\n"
|
55
55
|
output = map(AlignedInColumns, output)
|
56
56
|
output = "".join(output).rstrip()
|
57
57
|
|
logger_36/task/storage.py
CHANGED
@@ -39,7 +39,7 @@ def SaveLOGasHTML(path: str | path_t | io_base_t | None = None) -> None:
|
|
39
39
|
L.warning(f'{cannot_save}: File "{path}" already exists.')
|
40
40
|
return
|
41
41
|
|
42
|
-
html = L.
|
42
|
+
html = "\n".join(L.recorded)
|
43
43
|
if html is None:
|
44
44
|
L.warning(f"{cannot_save}: No handler could provide an HTML output.")
|
45
45
|
else:
|