logger-36 2024.18__py3-none-any.whl → 2024.20__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/config/console_rich.py +3 -0
- logger_36/catalog/handler/console_rich.py +78 -32
- logger_36/catalog/handler/generic.py +32 -3
- logger_36/handler.py +8 -0
- logger_36/logger.py +0 -1
- logger_36/task/storage.py +10 -12
- logger_36/type/logger.py +32 -9
- logger_36/version.py +1 -1
- {logger_36-2024.18.dist-info → logger_36-2024.20.dist-info}/METADATA +1 -1
- {logger_36-2024.18.dist-info → logger_36-2024.20.dist-info}/RECORD +12 -13
- {logger_36-2024.18.dist-info → logger_36-2024.20.dist-info}/WHEEL +1 -1
- logger_36/catalog/logger/exception.py +0 -74
- {logger_36-2024.18.dist-info → logger_36-2024.20.dist-info}/top_level.txt +0 -0
@@ -24,6 +24,9 @@ ACTUAL_COLOR = "indian_red"
|
|
24
24
|
EXPECTED_COLOR = "green"
|
25
25
|
ELAPSED_TIME_COLOR = "green"
|
26
26
|
|
27
|
+
ALTERNATIVE_BACKGROUND_FOR_LIGHT = style_t(bgcolor=color_t.from_rgb(230, 230, 230))
|
28
|
+
ALTERNATIVE_BACKGROUND_FOR_DARK = style_t(bgcolor=color_t.from_rgb(25, 25, 25))
|
29
|
+
|
27
30
|
GRAY_STYLE = style_t(color=color_t.from_rgb(150, 150, 150))
|
28
31
|
|
29
32
|
"""
|
@@ -10,6 +10,8 @@ import typing as h
|
|
10
10
|
|
11
11
|
from logger_36.catalog.config.console_rich import (
|
12
12
|
ACTUAL_COLOR,
|
13
|
+
ALTERNATIVE_BACKGROUND_FOR_DARK,
|
14
|
+
ALTERNATIVE_BACKGROUND_FOR_LIGHT,
|
13
15
|
DATE_TIME_COLOR,
|
14
16
|
ELAPSED_TIME_COLOR,
|
15
17
|
EXPECTED_COLOR,
|
@@ -49,9 +51,20 @@ _EXCLUSIVE_TRACEBACK_ARGUMENTS = (
|
|
49
51
|
|
50
52
|
@d.dataclass(slots=True, repr=False, eq=False)
|
51
53
|
class console_rich_handler_t(lggg.Handler):
|
54
|
+
"""
|
55
|
+
alternating_lines:
|
56
|
+
- Initial value:
|
57
|
+
- 1: enabled for dark background
|
58
|
+
- 2: enabled for light background
|
59
|
+
- anything else: disabled
|
60
|
+
- Runtime value: 0/1=do not/do highlight next time.
|
61
|
+
"""
|
62
|
+
|
52
63
|
extension: handler_extension_t = d.field(init=False)
|
53
64
|
console: console_t = d.field(init=False)
|
54
65
|
FormattedLines: h.Callable[..., tuple[str, str | None]] = d.field(init=False)
|
66
|
+
alternating_lines: int = 0
|
67
|
+
background_is_light: bool = True
|
55
68
|
|
56
69
|
name: d.InitVar[str | None] = None
|
57
70
|
level: d.InitVar[int] = lggg.NOTSET
|
@@ -60,6 +73,7 @@ class console_rich_handler_t(lggg.Handler):
|
|
60
73
|
message_width: d.InitVar[int] = -1
|
61
74
|
formatter: d.InitVar[lggg.Formatter | None] = None
|
62
75
|
should_install_traceback: d.InitVar[bool] = False
|
76
|
+
should_record: d.InitVar[bool] = False
|
63
77
|
|
64
78
|
rich_kwargs: d.InitVar[dict[str, h.Any] | None] = None
|
65
79
|
|
@@ -72,6 +86,7 @@ class console_rich_handler_t(lggg.Handler):
|
|
72
86
|
message_width: int,
|
73
87
|
formatter: lggg.Formatter | None,
|
74
88
|
should_install_traceback: bool,
|
89
|
+
should_record: bool,
|
75
90
|
rich_kwargs: dict[str, h.Any] | None,
|
76
91
|
) -> None:
|
77
92
|
""""""
|
@@ -103,7 +118,7 @@ class console_rich_handler_t(lggg.Handler):
|
|
103
118
|
self.console = console_t(
|
104
119
|
highlight=False,
|
105
120
|
force_terminal=True,
|
106
|
-
record=
|
121
|
+
record=should_record,
|
107
122
|
**rich_console_kwargs,
|
108
123
|
)
|
109
124
|
if should_install_traceback:
|
@@ -111,52 +126,83 @@ class console_rich_handler_t(lggg.Handler):
|
|
111
126
|
InstallTracebackHandler(**rich_traceback_kwargs)
|
112
127
|
|
113
128
|
self.FormattedLines = self.extension.FormattedLines
|
129
|
+
if self.alternating_lines == 1:
|
130
|
+
self.alternating_lines = 0
|
131
|
+
self.background_is_light = False
|
132
|
+
elif self.alternating_lines == 2:
|
133
|
+
self.alternating_lines = 0
|
134
|
+
self.background_is_light = True
|
135
|
+
else:
|
136
|
+
self.alternating_lines = -1
|
114
137
|
|
115
138
|
def emit(self, record: lggg.LogRecord, /) -> None:
|
116
139
|
""""""
|
117
|
-
cls = self.__class__
|
118
140
|
if hasattr(record, SHOW_W_RULE_ATTR):
|
119
141
|
richer = Rule(record.msg, DATE_TIME_COLOR)
|
120
142
|
else:
|
121
143
|
first, next_s = self.FormattedLines(record, PreProcessed=EscapedForRich)
|
122
|
-
|
144
|
+
should_highlight_back = self.alternating_lines == 1
|
145
|
+
if self.alternating_lines >= 0:
|
146
|
+
self.alternating_lines = (self.alternating_lines + 1) % 2
|
147
|
+
richer = HighlightedVersion(
|
148
|
+
self.console,
|
149
|
+
first,
|
150
|
+
next_s,
|
151
|
+
record.levelno,
|
152
|
+
should_highlight_back=should_highlight_back,
|
153
|
+
background_is_light=self.background_is_light,
|
154
|
+
)
|
123
155
|
self.console.print(richer, crop=False, overflow="ignore")
|
124
156
|
|
125
157
|
def ShowMessage(self, message: str, /) -> None:
|
126
158
|
""""""
|
127
159
|
self.console.print(message, crop=False, overflow="ignore")
|
128
160
|
|
129
|
-
@classmethod
|
130
|
-
def HighlightedVersion(
|
131
|
-
cls, first_line: str, next_lines: str | None, log_level: int, /
|
132
|
-
) -> renderable_t:
|
133
|
-
""""""
|
134
|
-
output = text_t(first_line)
|
135
|
-
|
136
|
-
# Used instead of _CONTEXT_LENGTH which might include \t, thus creating a
|
137
|
-
# mismatch between character length and length when displayed in console.
|
138
|
-
context_end = first_line.find(LEVEL_CLOSING)
|
139
|
-
elapsed_time_separator = first_line.rfind(ELAPSED_TIME_SEPARATOR)
|
140
|
-
where_separator = first_line.rfind(
|
141
|
-
WHERE_SEPARATOR, context_end, elapsed_time_separator
|
142
|
-
)
|
143
|
-
|
144
|
-
output.stylize(DATE_TIME_COLOR, end=TIME_LENGTH)
|
145
|
-
output.stylize(
|
146
|
-
LEVEL_COLOR[log_level],
|
147
|
-
start=TIME_LENGTH,
|
148
|
-
end=context_end + 1,
|
149
|
-
)
|
150
|
-
output.stylize(GRAY_STYLE, start=where_separator, end=elapsed_time_separator)
|
151
|
-
output.stylize(ELAPSED_TIME_COLOR, start=elapsed_time_separator)
|
152
|
-
|
153
|
-
if next_lines is not None:
|
154
|
-
output.append(next_lines)
|
155
161
|
|
156
|
-
|
157
|
-
|
162
|
+
def HighlightedVersion(
|
163
|
+
_: console_t,
|
164
|
+
first_line: str,
|
165
|
+
next_lines: str | None,
|
166
|
+
log_level: int,
|
167
|
+
/,
|
168
|
+
*,
|
169
|
+
should_highlight_back: bool = False,
|
170
|
+
background_is_light: bool = True,
|
171
|
+
) -> renderable_t:
|
172
|
+
""""""
|
173
|
+
output = text_t(first_line)
|
174
|
+
|
175
|
+
# Used instead of _CONTEXT_LENGTH which might include \t, thus creating a
|
176
|
+
# mismatch between character length and length when displayed in console.
|
177
|
+
context_end = first_line.find(LEVEL_CLOSING)
|
178
|
+
elapsed_time_separator = first_line.rfind(ELAPSED_TIME_SEPARATOR)
|
179
|
+
where_separator = first_line.rfind(
|
180
|
+
WHERE_SEPARATOR, context_end, elapsed_time_separator
|
181
|
+
)
|
182
|
+
|
183
|
+
output.stylize(DATE_TIME_COLOR, end=TIME_LENGTH)
|
184
|
+
output.stylize(
|
185
|
+
LEVEL_COLOR[log_level],
|
186
|
+
start=TIME_LENGTH,
|
187
|
+
end=context_end + 1,
|
188
|
+
)
|
189
|
+
output.stylize(GRAY_STYLE, start=where_separator, end=elapsed_time_separator)
|
190
|
+
output.stylize(ELAPSED_TIME_COLOR, start=elapsed_time_separator)
|
191
|
+
|
192
|
+
if next_lines is not None:
|
193
|
+
output.append(next_lines)
|
194
|
+
|
195
|
+
_ = output.highlight_regex(ACTUAL_PATTERNS, style=ACTUAL_COLOR)
|
196
|
+
_ = output.highlight_regex(EXPECTED_PATTERNS, style=EXPECTED_COLOR)
|
197
|
+
|
198
|
+
if should_highlight_back:
|
199
|
+
if background_is_light:
|
200
|
+
style = ALTERNATIVE_BACKGROUND_FOR_LIGHT
|
201
|
+
else:
|
202
|
+
style = ALTERNATIVE_BACKGROUND_FOR_DARK
|
203
|
+
output.stylize(style)
|
158
204
|
|
159
|
-
|
205
|
+
return output
|
160
206
|
|
161
207
|
|
162
208
|
"""
|
@@ -10,7 +10,7 @@ import typing as h
|
|
10
10
|
|
11
11
|
try:
|
12
12
|
from logger_36.catalog.config.console_rich import DATE_TIME_COLOR
|
13
|
-
from logger_36.catalog.handler.console_rich import
|
13
|
+
from logger_36.catalog.handler.console_rich import HighlightedVersion
|
14
14
|
from rich.console import Console as console_t
|
15
15
|
from rich.console import ConsoleOptions as console_options_t
|
16
16
|
from rich.markup import escape as EscapedForRich
|
@@ -32,11 +32,21 @@ interface_h = can_show_message_p | h.Callable[[str], None]
|
|
32
32
|
|
33
33
|
@d.dataclass(slots=True, repr=False, eq=False)
|
34
34
|
class generic_handler_t(lggg.Handler):
|
35
|
+
"""
|
36
|
+
alternating_lines:
|
37
|
+
- Initial value:
|
38
|
+
- 1: enabled for dark background
|
39
|
+
- 2: enabled for light background
|
40
|
+
- anything else: disabled
|
41
|
+
- Runtime value: 0/1=do not/do highlight next time.
|
42
|
+
"""
|
35
43
|
|
36
44
|
extension: handler_extension_t = d.field(init=False)
|
37
45
|
console: console_t = None
|
38
46
|
console_options: console_options_t = None
|
39
47
|
FormattedLines: h.Callable[..., tuple[str, str | None]] = d.field(init=False)
|
48
|
+
alternating_lines: int = 0
|
49
|
+
background_is_light: bool = True
|
40
50
|
ShowMessage: h.Callable[[str], None] = lambda _arg: None
|
41
51
|
|
42
52
|
name: d.InitVar[str | None] = None
|
@@ -47,6 +57,7 @@ class generic_handler_t(lggg.Handler):
|
|
47
57
|
formatter: d.InitVar[lggg.Formatter | None] = None
|
48
58
|
|
49
59
|
supports_html: d.InitVar[bool] = False
|
60
|
+
should_record: d.InitVar[bool] = False
|
50
61
|
rich_kwargs: d.InitVar[dict[str, h.Any] | None] = None
|
51
62
|
interface: d.InitVar[interface_h | None] = None # Cannot be None actually.
|
52
63
|
|
@@ -59,6 +70,7 @@ class generic_handler_t(lggg.Handler):
|
|
59
70
|
message_width: int,
|
60
71
|
formatter: lggg.Formatter | None,
|
61
72
|
supports_html: bool,
|
73
|
+
should_record: bool,
|
62
74
|
rich_kwargs: dict[str, h.Any] | None,
|
63
75
|
interface: interface_h | None,
|
64
76
|
) -> None:
|
@@ -81,6 +93,7 @@ class generic_handler_t(lggg.Handler):
|
|
81
93
|
self.console = console_t(
|
82
94
|
highlight=False,
|
83
95
|
force_terminal=True,
|
96
|
+
record=should_record,
|
84
97
|
**rich_kwargs,
|
85
98
|
)
|
86
99
|
self.console_options = self.console.options.update(
|
@@ -88,6 +101,14 @@ class generic_handler_t(lggg.Handler):
|
|
88
101
|
)
|
89
102
|
|
90
103
|
self.FormattedLines = self.extension.FormattedLines
|
104
|
+
if self.alternating_lines == 1:
|
105
|
+
self.alternating_lines = 0
|
106
|
+
self.background_is_light = False
|
107
|
+
elif self.alternating_lines == 2:
|
108
|
+
self.alternating_lines = 0
|
109
|
+
self.background_is_light = True
|
110
|
+
else:
|
111
|
+
self.alternating_lines = -1
|
91
112
|
|
92
113
|
self.ShowMessage = getattr(
|
93
114
|
interface, can_show_message_p.ShowMessage.__name__, interface
|
@@ -105,8 +126,16 @@ class generic_handler_t(lggg.Handler):
|
|
105
126
|
richer = Rule(record.msg, DATE_TIME_COLOR)
|
106
127
|
else:
|
107
128
|
first, next_s = self.FormattedLines(record, PreProcessed=EscapedForRich)
|
108
|
-
|
109
|
-
|
129
|
+
should_highlight_back = self.alternating_lines == 1
|
130
|
+
if self.alternating_lines >= 0:
|
131
|
+
self.alternating_lines = (self.alternating_lines + 1) % 2
|
132
|
+
richer = HighlightedVersion(
|
133
|
+
self.console,
|
134
|
+
first,
|
135
|
+
next_s,
|
136
|
+
record.levelno,
|
137
|
+
should_highlight_back=should_highlight_back,
|
138
|
+
background_is_light=self.background_is_light,
|
110
139
|
)
|
111
140
|
segments = self.console.render(richer, options=self.console_options)
|
112
141
|
|
logger_36/handler.py
CHANGED
@@ -38,6 +38,8 @@ def AddGenericHandler(
|
|
38
38
|
message_width: int = -1,
|
39
39
|
formatter: lggg.Formatter | None = None,
|
40
40
|
supports_html: bool = False,
|
41
|
+
alternating_lines: int = 2,
|
42
|
+
should_record: bool = False,
|
41
43
|
should_hold_messages: bool = False,
|
42
44
|
**kwargs,
|
43
45
|
) -> None:
|
@@ -53,6 +55,8 @@ def AddGenericHandler(
|
|
53
55
|
message_width=message_width,
|
54
56
|
formatter=formatter,
|
55
57
|
supports_html=supports_html,
|
58
|
+
alternating_lines=alternating_lines,
|
59
|
+
should_record=should_record,
|
56
60
|
rich_kwargs=kwargs,
|
57
61
|
interface=interface,
|
58
62
|
)
|
@@ -94,8 +98,10 @@ def AddRichConsoleHandler(
|
|
94
98
|
show_memory_usage: bool = False,
|
95
99
|
message_width: int = -1,
|
96
100
|
formatter: lggg.Formatter | None = None,
|
101
|
+
alternating_lines: int = 2,
|
97
102
|
should_hold_messages: bool = False,
|
98
103
|
should_install_traceback: bool = False,
|
104
|
+
should_record: bool = False,
|
99
105
|
**kwargs,
|
100
106
|
) -> None:
|
101
107
|
""""""
|
@@ -111,7 +117,9 @@ def AddRichConsoleHandler(
|
|
111
117
|
additional_s = {}
|
112
118
|
else:
|
113
119
|
additional_s = {
|
120
|
+
"alternating_lines": alternating_lines,
|
114
121
|
"should_install_traceback": should_install_traceback,
|
122
|
+
"should_record": should_record,
|
115
123
|
"rich_kwargs": kwargs,
|
116
124
|
}
|
117
125
|
handler = console_rich_handler_t(
|
logger_36/logger.py
CHANGED
@@ -5,7 +5,6 @@ SEE COPYRIGHT NOTICE BELOW
|
|
5
5
|
"""
|
6
6
|
|
7
7
|
from logger_36.catalog.logger.chronos import LogElapsedTime
|
8
|
-
from logger_36.catalog.logger.exception import LogException
|
9
8
|
from logger_36.catalog.logger.memory import LogMaximumMemoryUsage, LogMemoryUsages
|
10
9
|
from logger_36.catalog.logger.system import LogSystemDetails
|
11
10
|
|
logger_36/task/storage.py
CHANGED
@@ -101,22 +101,20 @@ def SaveLOGasHTML(path: str | path_t | h.TextIO = None) -> None:
|
|
101
101
|
LOGGER.warning(f'{cannot_save}: File "{path}" already exists.')
|
102
102
|
return
|
103
103
|
|
104
|
-
console = None
|
105
|
-
found = False
|
106
104
|
for handler in LOGGER.handlers:
|
107
105
|
console = getattr(handler, "console", None)
|
108
|
-
if
|
106
|
+
if isinstance(console, console_t) and console.record:
|
107
|
+
html = console.export_html()
|
108
|
+
if actual_file:
|
109
|
+
with open(path, "w") as accessor:
|
110
|
+
accessor.write(html)
|
111
|
+
else:
|
112
|
+
path.write(html)
|
109
113
|
break
|
110
|
-
|
111
|
-
if found:
|
112
|
-
html = console.export_html()
|
113
|
-
if actual_file:
|
114
|
-
with open(path, "w") as accessor:
|
115
|
-
accessor.write(html)
|
116
|
-
else:
|
117
|
-
path.write(html)
|
118
114
|
else:
|
119
|
-
LOGGER.warning(
|
115
|
+
LOGGER.warning(
|
116
|
+
f"{cannot_save}: No handler has a RICH console with recording ON."
|
117
|
+
)
|
120
118
|
|
121
119
|
|
122
120
|
"""
|
logger_36/type/logger.py
CHANGED
@@ -7,7 +7,7 @@ SEE COPYRIGHT NOTICE BELOW
|
|
7
7
|
import dataclasses as d
|
8
8
|
import logging as lggg
|
9
9
|
import sys as sstm
|
10
|
-
import traceback as
|
10
|
+
import traceback as tcbk
|
11
11
|
import types as t
|
12
12
|
import typing as h
|
13
13
|
from datetime import datetime as dttm
|
@@ -40,9 +40,10 @@ from logger_36.type.issue import NewIssue, issue_t
|
|
40
40
|
@d.dataclass(slots=True, repr=False, eq=False)
|
41
41
|
class logger_t(lggg.Logger):
|
42
42
|
name_: d.InitVar[str] = LOGGER_NAME
|
43
|
-
|
43
|
+
level_: d.InitVar[int] = lggg.NOTSET
|
44
44
|
activate_wrn_interceptions: d.InitVar[bool] = True
|
45
|
-
exit_on_error: bool = False
|
45
|
+
exit_on_error: bool = False # Implies exit_on_critical.
|
46
|
+
exit_on_critical: bool = False
|
46
47
|
# Must not be False until at least one handler has been added.
|
47
48
|
should_hold_messages: bool = True
|
48
49
|
|
@@ -58,15 +59,17 @@ class logger_t(lggg.Logger):
|
|
58
59
|
)
|
59
60
|
|
60
61
|
def __post_init__(
|
61
|
-
self, name_: str,
|
62
|
+
self, name_: str, level_: int, activate_wrn_interceptions: bool
|
62
63
|
) -> None:
|
63
64
|
""""""
|
64
65
|
lggg.Logger.__init__(self, name_)
|
65
|
-
self.setLevel(
|
66
|
-
self.propagate = False
|
66
|
+
self.setLevel(level_)
|
67
|
+
self.propagate = False # Part of lggg.Logger.
|
67
68
|
|
68
69
|
if activate_wrn_interceptions:
|
69
70
|
self._ActivateWarningInterceptions()
|
71
|
+
if self.exit_on_error:
|
72
|
+
self.exit_on_critical = True
|
70
73
|
|
71
74
|
def _ActivateWarningInterceptions(self) -> None:
|
72
75
|
"""
|
@@ -211,9 +214,29 @@ class logger_t(lggg.Logger):
|
|
211
214
|
else:
|
212
215
|
lggg.Logger.handle(self, record)
|
213
216
|
|
214
|
-
if self.
|
217
|
+
if (self.exit_on_critical and (record.levelno is lggg.CRITICAL)) or (
|
218
|
+
self.exit_on_error and (record.levelno is lggg.ERROR)
|
219
|
+
):
|
220
|
+
# Also works if self.exit_on_error and record.levelno is lggg.CRITICAL since
|
221
|
+
# __post_init__ set self.exit_on_critical if self.exit_on_error.
|
215
222
|
sstm.exit(1)
|
216
223
|
|
224
|
+
def error_for_exception(
|
225
|
+
self,
|
226
|
+
exception: Exception,
|
227
|
+
/,
|
228
|
+
*,
|
229
|
+
should_remove_caller: bool = False,
|
230
|
+
) -> None:
|
231
|
+
""""""
|
232
|
+
lines = tcbk.format_exception(exception)
|
233
|
+
if should_remove_caller:
|
234
|
+
message = "\n".join(lines[:1] + lines[2:])
|
235
|
+
else:
|
236
|
+
formatted = "".join(lines)
|
237
|
+
message = f"{type(exception).__name__}:\n{formatted}"
|
238
|
+
self.error(message)
|
239
|
+
|
217
240
|
def AddContextLevel(self, new_level: str, /) -> None:
|
218
241
|
""""""
|
219
242
|
self.context_levels.append(new_level)
|
@@ -285,11 +308,11 @@ class logger_t(lggg.Logger):
|
|
285
308
|
try:
|
286
309
|
raise level("\n" + issues)
|
287
310
|
except Exception as exception:
|
288
|
-
lines = ["Traceback (most recent call last):"] +
|
311
|
+
lines = ["Traceback (most recent call last):"] + tcbk.format_stack()[
|
289
312
|
:-1
|
290
313
|
]
|
291
314
|
lines[-1] = lines[-1][:-1]
|
292
|
-
lines.extend(
|
315
|
+
lines.extend(tcbk.format_exception_only(exception))
|
293
316
|
print("\n".join(lines), file=sstm.stderr)
|
294
317
|
sstm.exit(1)
|
295
318
|
|
logger_36/version.py
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
logger_36/__init__.py,sha256=jHidpp6dmfJVdoiHkwTXBn1_u1HRaZj3BHS8jq71ZOE,2312
|
2
2
|
logger_36/format.py,sha256=mox36RRkNUWbeHo3XkGGlik2CoyswDvDehRDtZkrnD0,2558
|
3
|
-
logger_36/handler.py,sha256=
|
4
|
-
logger_36/logger.py,sha256=
|
3
|
+
logger_36/handler.py,sha256=wHMj4OyQrUdhAxk_MCvPTBT1Ig3BYpfbqxHYfp91fOU,6697
|
4
|
+
logger_36/logger.py,sha256=7LJtdT7TmfFsn6r34iTr6OGvEjXlU6hKXEO2c5Lm2zY,2386
|
5
5
|
logger_36/logger_gpu.py,sha256=YYFk6aYQrBDJfxQaDm-ar16T6SlOSL6jJWTOgvpF4EU,2244
|
6
6
|
logger_36/measure.py,sha256=P507VNbVKAf4jYGnGX-3rlDrVbrYP0ZD3nxFmAFvhyI,2404
|
7
7
|
logger_36/storage.py,sha256=O8pDmiL0B3LJpKrhi8a9IMBXs6MwW6r1bMUn_cSDAaY,2246
|
8
|
-
logger_36/version.py,sha256=
|
9
|
-
logger_36/catalog/config/console_rich.py,sha256=
|
8
|
+
logger_36/version.py,sha256=kB3U_JCF0IuEPCcFU8AehWEFC7kSh7E7ogHrmnWf-zY,2206
|
9
|
+
logger_36/catalog/config/console_rich.py,sha256=QDkgSs3I7ZULvkd1q4J1hdvgyB857JJcJWxM9fdL51Y,2883
|
10
10
|
logger_36/catalog/handler/console.py,sha256=1WLtmxZCBj0AxLu5xey3VIVBKm02bp-Rc-eZOiFtXnU,3893
|
11
|
-
logger_36/catalog/handler/console_rich.py,sha256=
|
11
|
+
logger_36/catalog/handler/console_rich.py,sha256=v57EFAvCaH5ABoZ24lFn1ObCe_EntHpqzW7RJLs6Lik,8681
|
12
12
|
logger_36/catalog/handler/file.py,sha256=GS5nsfp0j0mzPak7vz8E7U4e5H95os_qfDjdM1Ywf0g,4345
|
13
|
-
logger_36/catalog/handler/generic.py,sha256=
|
13
|
+
logger_36/catalog/handler/generic.py,sha256=93hiUjp0EsmH9M-kUHLKiFmvwSWTzb4JeYH-4T-6aT4,8123
|
14
14
|
logger_36/catalog/logger/chronos.py,sha256=eLqQw8N9vaGO23OCf5RrYDPbUeu7epUvDt9rH-dN7i0,2522
|
15
|
-
logger_36/catalog/logger/exception.py,sha256=sL7sZ_bjNoof2xgOXvBzAi2xHrj7Pmjfkfhjzuy6NGs,2708
|
16
15
|
logger_36/catalog/logger/gpu.py,sha256=vUFSP17e7U4nenMi5IMlDiP3cZvXe6nqEDpoqzTavdg,3490
|
17
16
|
logger_36/catalog/logger/memory.py,sha256=Zel_UCnHqGAqf_YuKpvjt0OIOo9vwKYpFM9g_2bjir0,4790
|
18
17
|
logger_36/catalog/logger/system.py,sha256=FQ3w1zIN1ab6y8QYtcYDULhyJYy4iwTwHoDs8Mi2IdQ,3159
|
@@ -33,7 +32,7 @@ logger_36/constant/system.py,sha256=G2mzBTxRXoJMxb53TnmBaceMJC_q3WonoCG7y6nC_R8,
|
|
33
32
|
logger_36/instance/logger.py,sha256=ttKjl9MD7FUjqCWjv5w2hmmpDYxgaORcYf9NaaE9W_M,2246
|
34
33
|
logger_36/instance/loggers.py,sha256=RCWpC1NPAf6vXnFc9NqsSALv-x-FEzcH6k_OlxTxeQk,2251
|
35
34
|
logger_36/task/inspection.py,sha256=f9VkVrwMJ_ixV9rFu3XUNpmCbEgoo1tssqd2nMeGYLI,5028
|
36
|
-
logger_36/task/storage.py,sha256=
|
35
|
+
logger_36/task/storage.py,sha256=XaSeu-iBCa0N8HNpwCV7cLprj-lbOJocpTIKUgSOvsc,5668
|
37
36
|
logger_36/task/format/memory.py,sha256=ECOdHjdxIqXivOwtcmwpLDMYUrutIeOTCn1L4d3-U8k,4241
|
38
37
|
logger_36/task/format/message.py,sha256=X9qtXPxhXgCIjnRYBJn93vj4rW4I-7dJP6LaXD5Qu2o,4142
|
39
38
|
logger_36/task/format/rule.py,sha256=YEe8wG_QLy9vRZqmT2bWlvKT-Dxp4pGaZVmEuwwODyE,2598
|
@@ -41,9 +40,9 @@ logger_36/task/measure/chronos.py,sha256=t-y0bVm1SmF-3wI9pR9Bp6-qzVlsE94fZTZr5a_
|
|
41
40
|
logger_36/task/measure/memory.py,sha256=eVw5WOYLyn8o4O4mMArdX2MzsVuhhNDovjYEkk-MIaU,2504
|
42
41
|
logger_36/type/handler.py,sha256=BXpevZhLq5V_IdUfi_LZA4czzlH2SGLpgvbqUBe5X10,8311
|
43
42
|
logger_36/type/issue.py,sha256=cB8pSSJg9aqFPQ6yJr4TC2kJbngKGK8Hyq4ATBm6jAc,2973
|
44
|
-
logger_36/type/logger.py,sha256=
|
43
|
+
logger_36/type/logger.py,sha256=qC2ThKusY4RKcmxxWaO2Pg3TTStUxpVe4AcSuQBdU04,15123
|
45
44
|
logger_36/type/loggers.py,sha256=znqxWBnfQxvkg3VUfbTUvt3S6Kq0DAzWWepxQDt9suI,2871
|
46
|
-
logger_36-2024.
|
47
|
-
logger_36-2024.
|
48
|
-
logger_36-2024.
|
49
|
-
logger_36-2024.
|
45
|
+
logger_36-2024.20.dist-info/METADATA,sha256=iyBqlOa3h_y5wyAOCzS8uLDNMgJo1DrFb88cOaPNm6Q,6276
|
46
|
+
logger_36-2024.20.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
47
|
+
logger_36-2024.20.dist-info/top_level.txt,sha256=sM95BTMWmslEEgR_1pzwZsOeSp8C_QBiu8ImbFr0XLc,10
|
48
|
+
logger_36-2024.20.dist-info/RECORD,,
|
@@ -1,74 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Copyright CNRS/Inria/UniCA
|
3
|
-
Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
|
4
|
-
SEE COPYRIGHT NOTICE BELOW
|
5
|
-
"""
|
6
|
-
|
7
|
-
import traceback as tcbk
|
8
|
-
|
9
|
-
from logger_36.instance.logger import LOGGER
|
10
|
-
from logger_36.type.logger import logger_t
|
11
|
-
|
12
|
-
|
13
|
-
def LogException(
|
14
|
-
exception: Exception,
|
15
|
-
/,
|
16
|
-
*,
|
17
|
-
logger: logger_t = LOGGER,
|
18
|
-
should_remove_caller: bool = False,
|
19
|
-
) -> None:
|
20
|
-
""""""
|
21
|
-
lines = tcbk.format_exception(exception)
|
22
|
-
if should_remove_caller:
|
23
|
-
message = "\n".join(lines[:1] + lines[2:])
|
24
|
-
else:
|
25
|
-
formatted = "".join(lines)
|
26
|
-
message = f"{type(exception).__name__}:\n{formatted}"
|
27
|
-
logger.error(message)
|
28
|
-
|
29
|
-
|
30
|
-
"""
|
31
|
-
COPYRIGHT NOTICE
|
32
|
-
|
33
|
-
This software is governed by the CeCILL license under French law and
|
34
|
-
abiding by the rules of distribution of free software. You can use,
|
35
|
-
modify and/ or redistribute the software under the terms of the CeCILL
|
36
|
-
license as circulated by CEA, CNRS and INRIA at the following URL
|
37
|
-
"http://www.cecill.info".
|
38
|
-
|
39
|
-
As a counterpart to the access to the source code and rights to copy,
|
40
|
-
modify and redistribute granted by the license, users are provided only
|
41
|
-
with a limited warranty and the software's author, the holder of the
|
42
|
-
economic rights, and the successive licensors have only limited
|
43
|
-
liability.
|
44
|
-
|
45
|
-
In this respect, the user's attention is drawn to the risks associated
|
46
|
-
with loading, using, modifying and/or developing or reproducing the
|
47
|
-
software by the user in light of its specific status of free software,
|
48
|
-
that may mean that it is complicated to manipulate, and that also
|
49
|
-
therefore means that it is reserved for developers and experienced
|
50
|
-
professionals having in-depth computer knowledge. Users are therefore
|
51
|
-
encouraged to load and test the software's suitability as regards their
|
52
|
-
requirements in conditions enabling the security of their systems and/or
|
53
|
-
data to be ensured and, more generally, to use and operate it in the
|
54
|
-
same conditions as regards security.
|
55
|
-
|
56
|
-
The fact that you are presently reading this means that you have had
|
57
|
-
knowledge of the CeCILL license and that you accept its terms.
|
58
|
-
|
59
|
-
SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
|
60
|
-
|
61
|
-
This software is being developed by Eric Debreuve, a CNRS employee and
|
62
|
-
member of team Morpheme.
|
63
|
-
Team Morpheme is a joint team between Inria, CNRS, and UniCA.
|
64
|
-
It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
|
65
|
-
I3S, and Laboratory iBV.
|
66
|
-
|
67
|
-
CNRS: https://www.cnrs.fr/index.php/en
|
68
|
-
Inria: https://www.inria.fr/en/
|
69
|
-
UniCA: https://univ-cotedazur.eu/
|
70
|
-
Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
|
71
|
-
I3S: https://www.i3s.unice.fr/en/
|
72
|
-
iBV: http://ibv.unice.fr/
|
73
|
-
Team Morpheme: https://team.inria.fr/morpheme/
|
74
|
-
"""
|
File without changes
|