logger-36 2024.19__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/handler/generic.py +1 -1
- logger_36/logger.py +0 -1
- logger_36/type/logger.py +19 -3
- logger_36/version.py +1 -1
- {logger_36-2024.19.dist-info → logger_36-2024.20.dist-info}/METADATA +1 -1
- {logger_36-2024.19.dist-info → logger_36-2024.20.dist-info}/RECORD +8 -9
- {logger_36-2024.19.dist-info → logger_36-2024.20.dist-info}/WHEEL +1 -1
- logger_36/catalog/logger/exception.py +0 -74
- {logger_36-2024.19.dist-info → logger_36-2024.20.dist-info}/top_level.txt +0 -0
@@ -57,7 +57,7 @@ class generic_handler_t(lggg.Handler):
|
|
57
57
|
formatter: d.InitVar[lggg.Formatter | None] = None
|
58
58
|
|
59
59
|
supports_html: d.InitVar[bool] = False
|
60
|
-
should_record: d.InitVar[bool] =
|
60
|
+
should_record: d.InitVar[bool] = False
|
61
61
|
rich_kwargs: d.InitVar[dict[str, h.Any] | None] = None
|
62
62
|
interface: d.InitVar[interface_h | None] = None # Cannot be None actually.
|
63
63
|
|
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/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
|
@@ -221,6 +221,22 @@ class logger_t(lggg.Logger):
|
|
221
221
|
# __post_init__ set self.exit_on_critical if self.exit_on_error.
|
222
222
|
sstm.exit(1)
|
223
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
|
+
|
224
240
|
def AddContextLevel(self, new_level: str, /) -> None:
|
225
241
|
""""""
|
226
242
|
self.context_levels.append(new_level)
|
@@ -292,11 +308,11 @@ class logger_t(lggg.Logger):
|
|
292
308
|
try:
|
293
309
|
raise level("\n" + issues)
|
294
310
|
except Exception as exception:
|
295
|
-
lines = ["Traceback (most recent call last):"] +
|
311
|
+
lines = ["Traceback (most recent call last):"] + tcbk.format_stack()[
|
296
312
|
:-1
|
297
313
|
]
|
298
314
|
lines[-1] = lines[-1][:-1]
|
299
|
-
lines.extend(
|
315
|
+
lines.extend(tcbk.format_exception_only(exception))
|
300
316
|
print("\n".join(lines), file=sstm.stderr)
|
301
317
|
sstm.exit(1)
|
302
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
3
|
logger_36/handler.py,sha256=wHMj4OyQrUdhAxk_MCvPTBT1Ig3BYpfbqxHYfp91fOU,6697
|
4
|
-
logger_36/logger.py,sha256=
|
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=
|
8
|
+
logger_36/version.py,sha256=kB3U_JCF0IuEPCcFU8AehWEFC7kSh7E7ogHrmnWf-zY,2206
|
9
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
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
|
@@ -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
|