logger-36 2024.2__py3-none-any.whl → 2024.4__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/config/issue.py +4 -1
- logger_36/task/storage.py +3 -3
- logger_36/type/issue.py +2 -2
- logger_36/type/logger.py +18 -7
- logger_36/version.py +1 -1
- {logger_36-2024.2.dist-info → logger_36-2024.4.dist-info}/METADATA +2 -2
- {logger_36-2024.2.dist-info → logger_36-2024.4.dist-info}/RECORD +9 -9
- {logger_36-2024.2.dist-info → logger_36-2024.4.dist-info}/WHEEL +0 -0
- {logger_36-2024.2.dist-info → logger_36-2024.4.dist-info}/top_level.txt +0 -0
logger_36/config/issue.py
CHANGED
@@ -29,4 +29,7 @@
|
|
29
29
|
# The fact that you are presently reading this means that you have had
|
30
30
|
# knowledge of the CeCILL license and that you accept its terms.
|
31
31
|
|
32
|
-
|
32
|
+
ISSUE_BASE_CONTEXT = "BASE"
|
33
|
+
|
34
|
+
ISSUE_CONTEXT_SEPARATOR = ">"
|
35
|
+
ISSUE_CONTEXT_END = ":: "
|
logger_36/task/storage.py
CHANGED
@@ -43,11 +43,11 @@ except ModuleNotFoundError:
|
|
43
43
|
|
44
44
|
from logger_36.instance import LOGGER
|
45
45
|
|
46
|
+
_BODY_END_PATTERN = r"</[bB][oO][dD][yY]>(.|\n)*$"
|
47
|
+
|
46
48
|
|
47
49
|
@dtcl.dataclass(slots=True, repr=False, eq=False)
|
48
50
|
class html_reader_t(html_parser_t):
|
49
|
-
BODY_END_PATTERN: h.ClassVar[str] = r"</[bB][oO][dD][yY]>(.|\n)*$"
|
50
|
-
|
51
51
|
source: str = ""
|
52
52
|
inside_body: bool = dtcl.field(init=False, default=False)
|
53
53
|
body_position_start: tuple[int, int] = dtcl.field(init=False, default=(-1, -1))
|
@@ -85,7 +85,7 @@ class html_reader_t(html_parser_t):
|
|
85
85
|
output[self.body_position_start[0] : (self.body_position_end[0] + 1)]
|
86
86
|
)
|
87
87
|
output = output[self.body_position_start[1] :]
|
88
|
-
output = regx.sub(
|
88
|
+
output = regx.sub(_BODY_END_PATTERN, "", output, count=1)
|
89
89
|
|
90
90
|
return output.strip()
|
91
91
|
|
logger_36/type/issue.py
CHANGED
@@ -31,7 +31,7 @@
|
|
31
31
|
|
32
32
|
import typing as h
|
33
33
|
|
34
|
-
from logger_36.config.issue import
|
34
|
+
from logger_36.config.issue import ISSUE_BASE_CONTEXT
|
35
35
|
from logger_36.constant.generic import NOT_PASSED
|
36
36
|
from logger_36.task.format.message import FormattedMessage
|
37
37
|
|
@@ -49,7 +49,7 @@ def NewIssue(
|
|
49
49
|
) -> issue_t:
|
50
50
|
""""""
|
51
51
|
if context.__len__() == 0:
|
52
|
-
context =
|
52
|
+
context = ISSUE_BASE_CONTEXT
|
53
53
|
message = FormattedMessage(
|
54
54
|
message, actual=actual, expected=expected, with_final_dot=False
|
55
55
|
)
|
logger_36/type/logger.py
CHANGED
@@ -34,12 +34,14 @@ from __future__ import annotations
|
|
34
34
|
import dataclasses as dtcl
|
35
35
|
import logging as lggg
|
36
36
|
import sys as sstm
|
37
|
+
import traceback as tbck
|
37
38
|
import types as t
|
38
39
|
import typing as h
|
39
40
|
from datetime import datetime as dttm
|
40
41
|
from pathlib import Path as path_t
|
41
42
|
from traceback import TracebackException as traceback_t
|
42
43
|
|
44
|
+
from logger_36.config.issue import ISSUE_CONTEXT_END, ISSUE_CONTEXT_SEPARATOR
|
43
45
|
from logger_36.config.message import DATE_FORMAT, INTERCEPTED_LOG_SEPARATOR
|
44
46
|
from logger_36.constant.generic import NOT_PASSED
|
45
47
|
from logger_36.constant.issue import ORDER, order_h
|
@@ -62,9 +64,6 @@ from logger_36.type.issue import NewIssue, issue_t
|
|
62
64
|
|
63
65
|
@dtcl.dataclass(slots=True, repr=False, eq=False)
|
64
66
|
class logger_t(lggg.Logger):
|
65
|
-
ISSUE_CONTEXT_SEPARATOR: h.ClassVar[str] = ">"
|
66
|
-
ISSUE_CONTEXT_END: h.ClassVar[str] = ":: "
|
67
|
-
|
68
67
|
# Must not be False until at least one handler has been added.
|
69
68
|
should_hold_messages: bool = True
|
70
69
|
|
@@ -260,10 +259,9 @@ class logger_t(lggg.Logger):
|
|
260
259
|
expected: h.Any | None = None,
|
261
260
|
) -> None:
|
262
261
|
""""""
|
263
|
-
|
264
|
-
context = cls.ISSUE_CONTEXT_SEPARATOR.join(self.context_levels)
|
262
|
+
context = ISSUE_CONTEXT_SEPARATOR.join(self.context_levels)
|
265
263
|
issue = NewIssue(
|
266
|
-
context,
|
264
|
+
context, ISSUE_CONTEXT_END, message, actual=actual, expected=expected
|
267
265
|
)
|
268
266
|
self.staged_issues.append(issue)
|
269
267
|
|
@@ -274,7 +272,7 @@ class logger_t(lggg.Logger):
|
|
274
272
|
|
275
273
|
def CommitIssues(
|
276
274
|
self,
|
277
|
-
level: int,
|
275
|
+
level: int | type[Exception],
|
278
276
|
/,
|
279
277
|
*,
|
280
278
|
order: order_h = "when",
|
@@ -298,6 +296,19 @@ class logger_t(lggg.Logger):
|
|
298
296
|
issues = sorted(self.staged_issues, key=lambda _elm: _elm.context)
|
299
297
|
issues = "\n".join(issues)
|
300
298
|
|
299
|
+
if issubclass(level, Exception):
|
300
|
+
try:
|
301
|
+
raise level("\n" + issues)
|
302
|
+
except Exception as exception:
|
303
|
+
traceback = "Traceback (most recent call last):\n" + "\n".join(
|
304
|
+
tbck.format_stack()[:-1]
|
305
|
+
)
|
306
|
+
print(traceback[:-1], file=sstm.stderr)
|
307
|
+
print(
|
308
|
+
"\n".join(tbck.format_exception_only(exception)), file=sstm.stderr
|
309
|
+
)
|
310
|
+
sstm.exit(1)
|
311
|
+
|
301
312
|
self.log(level, issues, **HIDE_WHERE_KWARG)
|
302
313
|
self.staged_issues.clear()
|
303
314
|
|
logger_36/version.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: logger-36
|
3
|
-
Version: 2024.
|
4
|
-
Summary: Simple logger
|
3
|
+
Version: 2024.4
|
4
|
+
Summary: Simple logger with a catalog of handlers
|
5
5
|
Home-page: https://src.koda.cnrs.fr/eric.debreuve/logger-36/
|
6
6
|
Author: Eric Debreuve
|
7
7
|
Author-email: eric.debreuve@cnrs.fr
|
@@ -1,7 +1,7 @@
|
|
1
1
|
logger_36/__init__.py,sha256=-VGyte6TD6SWU4jBXUjur_xU1R1Asha5KXEwDNmGJ6Q,1756
|
2
2
|
logger_36/instance.py,sha256=NQlDAyXV3TNekX9xj9V7JMePmsa2DWnTDaVzh5dcyGM,1616
|
3
3
|
logger_36/main.py,sha256=hj3hctMBHJbPWw1078tJ_zOU-6-kEGCzMgHwpWY5ElA,6134
|
4
|
-
logger_36/version.py,sha256=
|
4
|
+
logger_36/version.py,sha256=b61fTunI_uzuupVlwY9m5iA0uH2qcxIRpuMvNp6g3BQ,1575
|
5
5
|
logger_36/catalog/config/console_rich.py,sha256=jJnYXPDsMCTu8zny2X3NdeyKFCfhJupberqIBxyv3LA,2030
|
6
6
|
logger_36/catalog/handler/console.py,sha256=PnaCWJsXN-x_-X8i-4o4HWys-7K0A83s4kIdtmDz3AQ,3092
|
7
7
|
logger_36/catalog/handler/console_rich.py,sha256=YqKyKwHoYCEVnW1S87NDu3ReTCIzSdYgC-20-813TFQ,5395
|
@@ -11,7 +11,7 @@ logger_36/catalog/logging/chronos.py,sha256=5SWyRUhwwKeJg3NPf9jkCqtKc7b_4x58Slbq
|
|
11
11
|
logger_36/catalog/logging/gpu.py,sha256=OpSQK0paA-xzxeWTKAx9QUqEytFyYvHgiVvWe97-rZ8,2465
|
12
12
|
logger_36/catalog/logging/memory.py,sha256=50wX25rXnI8NLlr3gp6793hKUE988CACIXVLMQRUcMs,4038
|
13
13
|
logger_36/catalog/logging/system.py,sha256=BzJLBvhyIE5nfUZJo4f1PPmu47YufVyin5ssX9GpXVU,2447
|
14
|
-
logger_36/config/issue.py,sha256=
|
14
|
+
logger_36/config/issue.py,sha256=fxlAFmJVAdUZQVDYvkVFC7hGsL01tIx4GaB5UG4M-tY,1637
|
15
15
|
logger_36/config/memory.py,sha256=_cJE_ku9adDk2Pb9jvyQIRilvYRS2uofB8hfTucRrwo,1587
|
16
16
|
logger_36/config/message.py,sha256=8AzmioSYDuguK1KN1a84yX0EE-1AnMb7XYgoImtorEA,2056
|
17
17
|
logger_36/config/system.py,sha256=d4dddB8IknyGmvOmUdi9Bunc60mEXjwB3AvjyrpCKrY,1847
|
@@ -24,16 +24,16 @@ logger_36/constant/message.py,sha256=vT9AukWubfwuQIO10eeR0EMO0Sov9-vLPj95Mg4WPsA
|
|
24
24
|
logger_36/constant/record.py,sha256=79NZCveVyCvwIWOMGmFrdMXsOLdJullguPbY4TB8EZY,1681
|
25
25
|
logger_36/constant/system.py,sha256=CLfopBgUhkegE-VQxGRxPMJGanIcK6vkhix8ZzEG5V0,1800
|
26
26
|
logger_36/task/inspection.py,sha256=Ozgj_2iQqHEmn6VQPh2rAZJ5233SD1WotFNUOXvukW4,4397
|
27
|
-
logger_36/task/storage.py,sha256=
|
27
|
+
logger_36/task/storage.py,sha256=BsaNdtVx9XF-Pt_V7rqP6UKyJ7G03_gX1FVM7mnBay0,5026
|
28
28
|
logger_36/task/format/memory.py,sha256=ZeDM6pCMRh81iSifQjiaYHVmKzzR5JhVTqAKd3Dju0U,3610
|
29
29
|
logger_36/task/format/message.py,sha256=XAqdR8NWFo-EnzUzaRBFO6jyYb0Su7jCgVQ1HLelxHs,3511
|
30
30
|
logger_36/task/format/rule.py,sha256=elNk65Y7HT42otObwfds-DwGwfZae0A77nDPCZuMcGE,1968
|
31
31
|
logger_36/task/measure/chronos.py,sha256=qT80jxZm_dAg2P4WkfU0L3PRvRojT21Ps3DtNYqGdrg,2253
|
32
32
|
logger_36/task/measure/memory.py,sha256=1f1X-XHd_58LJYJ0Ok5TGIagnf0k5F39IFqWHN2Ojas,1874
|
33
33
|
logger_36/type/extension.py,sha256=fsYx0wT1bR6DtpM2VnaxsM0MFv2vBLROgRSCs4duasY,5198
|
34
|
-
logger_36/type/issue.py,sha256=
|
35
|
-
logger_36/type/logger.py,sha256=
|
36
|
-
logger_36-2024.
|
37
|
-
logger_36-2024.
|
38
|
-
logger_36-2024.
|
39
|
-
logger_36-2024.
|
34
|
+
logger_36/type/issue.py,sha256=T1WFtc8Js1OChYkIHQiOP825Dcb9atpEprLWaPTxAHA,2151
|
35
|
+
logger_36/type/logger.py,sha256=jCmY-pxPT-4XLUpBNd81mPHasJZNVl5CaLEjLZyrCco,12731
|
36
|
+
logger_36-2024.4.dist-info/METADATA,sha256=_zL8RSuzNN7ruojiwBQol923L0t0oTZ9pcrGc1ELvtc,4236
|
37
|
+
logger_36-2024.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
38
|
+
logger_36-2024.4.dist-info/top_level.txt,sha256=sM95BTMWmslEEgR_1pzwZsOeSp8C_QBiu8ImbFr0XLc,10
|
39
|
+
logger_36-2024.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|