logger-36 2024.6__py3-none-any.whl → 2024.7__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/generic.py +9 -6
- logger_36/type/logger.py +2 -1
- logger_36/version.py +1 -1
- {logger_36-2024.6.dist-info → logger_36-2024.7.dist-info}/METADATA +1 -1
- {logger_36-2024.6.dist-info → logger_36-2024.7.dist-info}/RECORD +7 -7
- {logger_36-2024.6.dist-info → logger_36-2024.7.dist-info}/WHEEL +0 -0
- {logger_36-2024.6.dist-info → logger_36-2024.7.dist-info}/top_level.txt +0 -0
@@ -33,6 +33,8 @@ import dataclasses as dtcl
|
|
33
33
|
import logging as lggg
|
34
34
|
import typing as h
|
35
35
|
|
36
|
+
from logger_36.catalog.config.console_rich import DATE_TIME_COLOR
|
37
|
+
|
36
38
|
try:
|
37
39
|
from rich.console import Console as console_t
|
38
40
|
from rich.markup import escape as EscapedForRich
|
@@ -42,7 +44,7 @@ except ModuleNotFoundError:
|
|
42
44
|
|
43
45
|
from logger_36.catalog.handler.console_rich import console_rich_handler_t
|
44
46
|
from logger_36.constant.record import SHOW_W_RULE_ATTR
|
45
|
-
from logger_36.task.format.rule import Rule
|
47
|
+
from logger_36.task.format.rule import Rule, RuleAsText
|
46
48
|
from logger_36.type.extension import handler_extension_t
|
47
49
|
|
48
50
|
|
@@ -69,7 +71,7 @@ class generic_handler_t(lggg.Handler):
|
|
69
71
|
|
70
72
|
supports_html: dtcl.InitVar[bool] = False
|
71
73
|
rich_kwargs: dtcl.InitVar[dict[str, h.Any] | None] = None
|
72
|
-
interface: dtcl.InitVar[interface_h | None] = None
|
74
|
+
interface: dtcl.InitVar[interface_h | None] = None # Cannot be None actually.
|
73
75
|
|
74
76
|
def __post_init__(
|
75
77
|
self,
|
@@ -105,8 +107,6 @@ class generic_handler_t(lggg.Handler):
|
|
105
107
|
|
106
108
|
self.FormattedLines = self.extension.FormattedLines
|
107
109
|
|
108
|
-
if interface is None:
|
109
|
-
raise ValueError("Interface cannot be None.")
|
110
110
|
self.ShowMessage = getattr(
|
111
111
|
interface, can_show_message_p.ShowMessage.__name__, interface
|
112
112
|
)
|
@@ -114,10 +114,13 @@ class generic_handler_t(lggg.Handler):
|
|
114
114
|
def emit(self, record: lggg.LogRecord, /) -> None:
|
115
115
|
""""""
|
116
116
|
if self.console is None:
|
117
|
-
|
117
|
+
if hasattr(record, SHOW_W_RULE_ATTR):
|
118
|
+
message = RuleAsText(record.msg)
|
119
|
+
else:
|
120
|
+
message, _ = self.FormattedLines(record, should_join_lines=True)
|
118
121
|
else:
|
119
122
|
if hasattr(record, SHOW_W_RULE_ATTR):
|
120
|
-
richer = Rule(record.msg,
|
123
|
+
richer = Rule(record.msg, DATE_TIME_COLOR)
|
121
124
|
else:
|
122
125
|
first, next_s = self.FormattedLines(record, PreProcessed=EscapedForRich)
|
123
126
|
richer = console_rich_handler_t.HighlightedVersion(
|
logger_36/type/logger.py
CHANGED
@@ -216,9 +216,10 @@ class logger_t(lggg.Logger):
|
|
216
216
|
date = dttm.now().strftime(DATE_FORMAT)
|
217
217
|
if date != self.last_message_date:
|
218
218
|
self.last_message_date = date
|
219
|
-
# levelno
|
219
|
+
# levelno: Added for management by lggg.Logger.handle.
|
220
220
|
date_record = lggg.makeLogRecord(
|
221
221
|
{
|
222
|
+
"name": self.name,
|
222
223
|
"levelno": lggg.INFO,
|
223
224
|
"msg": f"DATE: {date}",
|
224
225
|
SHOW_W_RULE_ATTR: True,
|
logger_36/version.py
CHANGED
@@ -1,12 +1,12 @@
|
|
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=kdv79ZTpapb9ltLoKfSfR89CdPxDlizUJs6IctSRTqE,6690
|
4
|
-
logger_36/version.py,sha256=
|
4
|
+
logger_36/version.py,sha256=SHjFKsAo5HXmWz3ywjHv2B73Nbgz9BAn0t-SnGZbTBQ,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=pTczLjsEB78DT4ph57yLeQKPTcJVXpc3Q99d_I4YOk0,6512
|
8
8
|
logger_36/catalog/handler/file.py,sha256=BAxA-ZQAikmH0R9Ia3mbSXf-Z60-FfA4ElOVjjmanS0,3507
|
9
|
-
logger_36/catalog/handler/generic.py,sha256=
|
9
|
+
logger_36/catalog/handler/generic.py,sha256=wrFbA8oLb0wdAE4lnfbsAqRnAJOtaQV9TWTgTHGHhhM,6048
|
10
10
|
logger_36/catalog/logging/chronos.py,sha256=5SWyRUhwwKeJg3NPf9jkCqtKc7b_4x58Slbq2iMA8kE,1814
|
11
11
|
logger_36/catalog/logging/gpu.py,sha256=OpSQK0paA-xzxeWTKAx9QUqEytFyYvHgiVvWe97-rZ8,2465
|
12
12
|
logger_36/catalog/logging/memory.py,sha256=50wX25rXnI8NLlr3gp6793hKUE988CACIXVLMQRUcMs,4038
|
@@ -32,8 +32,8 @@ logger_36/task/measure/chronos.py,sha256=qT80jxZm_dAg2P4WkfU0L3PRvRojT21Ps3DtNYq
|
|
32
32
|
logger_36/task/measure/memory.py,sha256=1f1X-XHd_58LJYJ0Ok5TGIagnf0k5F39IFqWHN2Ojas,1874
|
33
33
|
logger_36/type/extension.py,sha256=fsYx0wT1bR6DtpM2VnaxsM0MFv2vBLROgRSCs4duasY,5198
|
34
34
|
logger_36/type/issue.py,sha256=T1WFtc8Js1OChYkIHQiOP825Dcb9atpEprLWaPTxAHA,2151
|
35
|
-
logger_36/type/logger.py,sha256=
|
36
|
-
logger_36-2024.
|
37
|
-
logger_36-2024.
|
38
|
-
logger_36-2024.
|
39
|
-
logger_36-2024.
|
35
|
+
logger_36/type/logger.py,sha256=WIcFOiZkOzKJzxf-7-hd9NZ5GHbxoJBmckp4sqh4tD0,12766
|
36
|
+
logger_36-2024.7.dist-info/METADATA,sha256=53WJXqKt_mPtxz8yT7JvKcSzjT1ziS8GCloDwN0WITI,4246
|
37
|
+
logger_36-2024.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
38
|
+
logger_36-2024.7.dist-info/top_level.txt,sha256=sM95BTMWmslEEgR_1pzwZsOeSp8C_QBiu8ImbFr0XLc,10
|
39
|
+
logger_36-2024.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|