logger-36 2024.24__py3-none-any.whl → 2024.25__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/__init__.py CHANGED
@@ -5,7 +5,6 @@ SEE COPYRIGHT NOTICE BELOW
5
5
  """
6
6
 
7
7
  from logger_36.instance.logger import LOGGER
8
- from logger_36.type.logger import logger_t
9
8
  from logger_36.version import __version__
10
9
 
11
10
  """
@@ -0,0 +1,53 @@
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
+ from logger_36.type.logger import logger_t
8
+
9
+ """
10
+ COPYRIGHT NOTICE
11
+
12
+ This software is governed by the CeCILL license under French law and
13
+ abiding by the rules of distribution of free software. You can use,
14
+ modify and/ or redistribute the software under the terms of the CeCILL
15
+ license as circulated by CEA, CNRS and INRIA at the following URL
16
+ "http://www.cecill.info".
17
+
18
+ As a counterpart to the access to the source code and rights to copy,
19
+ modify and redistribute granted by the license, users are provided only
20
+ with a limited warranty and the software's author, the holder of the
21
+ economic rights, and the successive licensors have only limited
22
+ liability.
23
+
24
+ In this respect, the user's attention is drawn to the risks associated
25
+ with loading, using, modifying and/or developing or reproducing the
26
+ software by the user in light of its specific status of free software,
27
+ that may mean that it is complicated to manipulate, and that also
28
+ therefore means that it is reserved for developers and experienced
29
+ professionals having in-depth computer knowledge. Users are therefore
30
+ encouraged to load and test the software's suitability as regards their
31
+ requirements in conditions enabling the security of their systems and/or
32
+ data to be ensured and, more generally, to use and operate it in the
33
+ same conditions as regards security.
34
+
35
+ The fact that you are presently reading this means that you have had
36
+ knowledge of the CeCILL license and that you accept its terms.
37
+
38
+ SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
39
+
40
+ This software is being developed by Eric Debreuve, a CNRS employee and
41
+ member of team Morpheme.
42
+ Team Morpheme is a joint team between Inria, CNRS, and UniCA.
43
+ It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
44
+ I3S, and Laboratory iBV.
45
+
46
+ CNRS: https://www.cnrs.fr/index.php/en
47
+ Inria: https://www.inria.fr/en/
48
+ UniCA: https://univ-cotedazur.eu/
49
+ Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
50
+ I3S: https://www.i3s.unice.fr/en/
51
+ iBV: http://ibv.unice.fr/
52
+ Team Morpheme: https://team.inria.fr/morpheme/
53
+ """
@@ -0,0 +1,53 @@
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
+ from logger_36.task.storage import html_reader_t
8
+
9
+ """
10
+ COPYRIGHT NOTICE
11
+
12
+ This software is governed by the CeCILL license under French law and
13
+ abiding by the rules of distribution of free software. You can use,
14
+ modify and/ or redistribute the software under the terms of the CeCILL
15
+ license as circulated by CEA, CNRS and INRIA at the following URL
16
+ "http://www.cecill.info".
17
+
18
+ As a counterpart to the access to the source code and rights to copy,
19
+ modify and redistribute granted by the license, users are provided only
20
+ with a limited warranty and the software's author, the holder of the
21
+ economic rights, and the successive licensors have only limited
22
+ liability.
23
+
24
+ In this respect, the user's attention is drawn to the risks associated
25
+ with loading, using, modifying and/or developing or reproducing the
26
+ software by the user in light of its specific status of free software,
27
+ that may mean that it is complicated to manipulate, and that also
28
+ therefore means that it is reserved for developers and experienced
29
+ professionals having in-depth computer knowledge. Users are therefore
30
+ encouraged to load and test the software's suitability as regards their
31
+ requirements in conditions enabling the security of their systems and/or
32
+ data to be ensured and, more generally, to use and operate it in the
33
+ same conditions as regards security.
34
+
35
+ The fact that you are presently reading this means that you have had
36
+ knowledge of the CeCILL license and that you accept its terms.
37
+
38
+ SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
39
+
40
+ This software is being developed by Eric Debreuve, a CNRS employee and
41
+ member of team Morpheme.
42
+ Team Morpheme is a joint team between Inria, CNRS, and UniCA.
43
+ It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
44
+ I3S, and Laboratory iBV.
45
+
46
+ CNRS: https://www.cnrs.fr/index.php/en
47
+ Inria: https://www.inria.fr/en/
48
+ UniCA: https://univ-cotedazur.eu/
49
+ Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
50
+ I3S: https://www.i3s.unice.fr/en/
51
+ iBV: http://ibv.unice.fr/
52
+ Team Morpheme: https://team.inria.fr/morpheme/
53
+ """
logger_36/content.py ADDED
@@ -0,0 +1,54 @@
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
+ from logger_36.task.format.message import FormattedMessage
8
+ from logger_36.task.format.rule import Rule, RuleAsText
9
+
10
+ """
11
+ COPYRIGHT NOTICE
12
+
13
+ This software is governed by the CeCILL license under French law and
14
+ abiding by the rules of distribution of free software. You can use,
15
+ modify and/ or redistribute the software under the terms of the CeCILL
16
+ license as circulated by CEA, CNRS and INRIA at the following URL
17
+ "http://www.cecill.info".
18
+
19
+ As a counterpart to the access to the source code and rights to copy,
20
+ modify and redistribute granted by the license, users are provided only
21
+ with a limited warranty and the software's author, the holder of the
22
+ economic rights, and the successive licensors have only limited
23
+ liability.
24
+
25
+ In this respect, the user's attention is drawn to the risks associated
26
+ with loading, using, modifying and/or developing or reproducing the
27
+ software by the user in light of its specific status of free software,
28
+ that may mean that it is complicated to manipulate, and that also
29
+ therefore means that it is reserved for developers and experienced
30
+ professionals having in-depth computer knowledge. Users are therefore
31
+ encouraged to load and test the software's suitability as regards their
32
+ requirements in conditions enabling the security of their systems and/or
33
+ data to be ensured and, more generally, to use and operate it in the
34
+ same conditions as regards security.
35
+
36
+ The fact that you are presently reading this means that you have had
37
+ knowledge of the CeCILL license and that you accept its terms.
38
+
39
+ SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
40
+
41
+ This software is being developed by Eric Debreuve, a CNRS employee and
42
+ member of team Morpheme.
43
+ Team Morpheme is a joint team between Inria, CNRS, and UniCA.
44
+ It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
45
+ I3S, and Laboratory iBV.
46
+
47
+ CNRS: https://www.cnrs.fr/index.php/en
48
+ Inria: https://www.inria.fr/en/
49
+ UniCA: https://univ-cotedazur.eu/
50
+ Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
51
+ I3S: https://www.i3s.unice.fr/en/
52
+ iBV: http://ibv.unice.fr/
53
+ Team Morpheme: https://team.inria.fr/morpheme/
54
+ """
logger_36/exception.py ADDED
@@ -0,0 +1,98 @@
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 sys as sstm
8
+ import tempfile as tmpf
9
+ import traceback as tcbk
10
+ import types as t
11
+
12
+ _ORIGINAL_EXCEPTION_HANDLER = sstm.excepthook
13
+
14
+
15
+ def OverrideExceptionFormat() -> None:
16
+ """"""
17
+ sstm.excepthook = _HandleException
18
+
19
+
20
+ def ResetExceptionFormat() -> None:
21
+ """"""
22
+ sstm.excepthook = _ORIGINAL_EXCEPTION_HANDLER
23
+
24
+
25
+ def _HandleException(
26
+ stripe: type[Exception], exception: Exception, trace: t.TracebackType, /
27
+ ) -> None:
28
+ """"""
29
+ while trace.tb_next is not None:
30
+ trace = trace.tb_next
31
+ frame = trace.tb_frame
32
+ module = frame.f_code.co_filename
33
+ function = frame.f_code.co_name
34
+ line = frame.f_lineno
35
+
36
+ message = str(exception)
37
+ if message.__len__() > 0:
38
+ message = f" {message}\n"
39
+
40
+ document = tmpf.NamedTemporaryFile(delete=False)
41
+
42
+ print(
43
+ f"{stripe.__name__}\n {module}.{function}@{line}\n{message} Full report at: {document.name}",
44
+ file=sstm.stderr,
45
+ )
46
+
47
+ lines = tcbk.format_exception(exception)
48
+ message = "".join(lines)
49
+
50
+ document.write(message.encode())
51
+ document.close()
52
+
53
+
54
+ """
55
+ COPYRIGHT NOTICE
56
+
57
+ This software is governed by the CeCILL license under French law and
58
+ abiding by the rules of distribution of free software. You can use,
59
+ modify and/ or redistribute the software under the terms of the CeCILL
60
+ license as circulated by CEA, CNRS and INRIA at the following URL
61
+ "http://www.cecill.info".
62
+
63
+ As a counterpart to the access to the source code and rights to copy,
64
+ modify and redistribute granted by the license, users are provided only
65
+ with a limited warranty and the software's author, the holder of the
66
+ economic rights, and the successive licensors have only limited
67
+ liability.
68
+
69
+ In this respect, the user's attention is drawn to the risks associated
70
+ with loading, using, modifying and/or developing or reproducing the
71
+ software by the user in light of its specific status of free software,
72
+ that may mean that it is complicated to manipulate, and that also
73
+ therefore means that it is reserved for developers and experienced
74
+ professionals having in-depth computer knowledge. Users are therefore
75
+ encouraged to load and test the software's suitability as regards their
76
+ requirements in conditions enabling the security of their systems and/or
77
+ data to be ensured and, more generally, to use and operate it in the
78
+ same conditions as regards security.
79
+
80
+ The fact that you are presently reading this means that you have had
81
+ knowledge of the CeCILL license and that you accept its terms.
82
+
83
+ SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
84
+
85
+ This software is being developed by Eric Debreuve, a CNRS employee and
86
+ member of team Morpheme.
87
+ Team Morpheme is a joint team between Inria, CNRS, and UniCA.
88
+ It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
89
+ I3S, and Laboratory iBV.
90
+
91
+ CNRS: https://www.cnrs.fr/index.php/en
92
+ Inria: https://www.inria.fr/en/
93
+ UniCA: https://univ-cotedazur.eu/
94
+ Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
95
+ I3S: https://www.i3s.unice.fr/en/
96
+ iBV: http://ibv.unice.fr/
97
+ Team Morpheme: https://team.inria.fr/morpheme/
98
+ """
@@ -4,13 +4,14 @@ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
4
4
  SEE COPYRIGHT NOTICE BELOW
5
5
  """
6
6
 
7
+ from logger_36.catalog.logger.memory import LogMaximumMemoryUsage, LogMemoryUsages
7
8
  from logger_36.task.format.memory import FormattedUsage as FormattedMemoryUsage
8
9
  from logger_36.task.format.memory import (
9
10
  FormattedUsageWithAutoUnit as FormattedMemoryUsageWithAutoUnit,
10
11
  )
11
12
  from logger_36.task.format.memory import UsageBar as MemoryUsageBar
12
- from logger_36.task.format.message import FormattedMessage
13
- from logger_36.task.format.rule import Rule, RuleAsText
13
+ from logger_36.task.measure.memory import CanCheckUsage as CanCheckMemoryUsage
14
+ from logger_36.task.measure.memory import CurrentUsage as CurrentMemoryUsage
14
15
 
15
16
  """
16
17
  COPYRIGHT NOTICE
logger_36/storage.py CHANGED
@@ -4,7 +4,7 @@ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
4
4
  SEE COPYRIGHT NOTICE BELOW
5
5
  """
6
6
 
7
- from logger_36.task.storage import SaveLOGasHTML, html_reader_t
7
+ from logger_36.task.storage import SaveLOGasHTML
8
8
 
9
9
  """
10
10
  COPYRIGHT NOTICE
@@ -4,8 +4,6 @@ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
4
4
  SEE COPYRIGHT NOTICE BELOW
5
5
  """
6
6
 
7
- from logger_36.catalog.logger.chronos import LogElapsedTime
8
- from logger_36.catalog.logger.memory import LogMaximumMemoryUsage, LogMemoryUsages
9
7
  from logger_36.catalog.logger.system import LogSystemDetails
10
8
 
11
9
  """
@@ -12,14 +12,9 @@ from datetime import datetime as dttm
12
12
  _START_DATE_AND_TIME = dttm.now()
13
13
 
14
14
 
15
- def TimeStamp() -> str:
15
+ def TimeStamp(*, precision: str = "microseconds") -> str:
16
16
  """"""
17
- return (
18
- dttm.now()
19
- .isoformat(timespec="milliseconds")
20
- .replace(".", "-")
21
- .replace(":", "-")
22
- )
17
+ return dttm.now().isoformat(timespec=precision).replace(".", "-").replace(":", "-")
23
18
 
24
19
 
25
20
  def ElapsedTime() -> str:
@@ -4,9 +4,8 @@ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
4
4
  SEE COPYRIGHT NOTICE BELOW
5
5
  """
6
6
 
7
+ from logger_36.catalog.logger.chronos import LogElapsedTime
7
8
  from logger_36.task.measure.chronos import ElapsedTime, TimeStamp
8
- from logger_36.task.measure.memory import CanCheckUsage as CanCheckMemoryUsage
9
- from logger_36.task.measure.memory import CurrentUsage as CurrentMemoryUsage
10
9
 
11
10
  """
12
11
  COPYRIGHT NOTICE
logger_36/type/logger.py CHANGED
@@ -238,7 +238,7 @@ class logger_t(lggg.Logger):
238
238
  message: str,
239
239
  /,
240
240
  *,
241
- level: int = lggg.ERROR,
241
+ level: int | str = lggg.ERROR,
242
242
  actual: h.Any = NOT_PASSED,
243
243
  expected: h.Any | None = None,
244
244
  expected_is_choices: bool = False,
@@ -246,6 +246,8 @@ class logger_t(lggg.Logger):
246
246
  with_final_dot: bool = True,
247
247
  ) -> None:
248
248
  """"""
249
+ if isinstance(level, str):
250
+ level = lggg.getLevelNamesMapping()[level.upper()]
249
251
  message = FormattedMessage(
250
252
  message,
251
253
  actual=actual,
@@ -261,10 +263,12 @@ class logger_t(lggg.Logger):
261
263
  exception: Exception,
262
264
  /,
263
265
  *,
264
- level: int = lggg.ERROR,
266
+ level: int | str = lggg.ERROR,
265
267
  should_remove_caller: bool = False,
266
268
  ) -> None:
267
269
  """"""
270
+ if isinstance(level, str):
271
+ level = lggg.getLevelNamesMapping()[level.upper()]
268
272
  lines = tcbk.format_exception(exception)
269
273
  if should_remove_caller:
270
274
  message = "\n".join(lines[:1] + lines[2:])
logger_36/version.py CHANGED
@@ -4,7 +4,7 @@ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
4
4
  SEE COPYRIGHT NOTICE BELOW
5
5
  """
6
6
 
7
- __version__ = "2024.24"
7
+ __version__ = "2024.25"
8
8
 
9
9
  """
10
10
  COPYRIGHT NOTICE
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: logger-36
3
- Version: 2024.24
3
+ Version: 2024.25
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
@@ -1,11 +1,15 @@
1
- logger_36/__init__.py,sha256=jHidpp6dmfJVdoiHkwTXBn1_u1HRaZj3BHS8jq71ZOE,2312
2
- logger_36/format.py,sha256=mox36RRkNUWbeHo3XkGGlik2CoyswDvDehRDtZkrnD0,2558
1
+ logger_36/__init__.py,sha256=NtDTs3eMKaXTJeujmgj1um3cBVLti0tYuOsdtVk9o9Q,2269
2
+ logger_36/content.py,sha256=bcMHw_HWJeolnP7KcKREpWbSy9IqWO44beBrisdgeQo,2297
3
+ logger_36/exception.py,sha256=UsFcsAvd1L4aLj6h7T-DilDm6yO501HDYnGekibiMAU,3260
4
+ logger_36/gpu.py,sha256=YYFk6aYQrBDJfxQaDm-ar16T6SlOSL6jJWTOgvpF4EU,2244
3
5
  logger_36/handler.py,sha256=9KUu02RpKGKBR358gqS5G1Zut5C6MyBgGzRsQYFBAtY,6721
4
- logger_36/logger.py,sha256=7LJtdT7TmfFsn6r34iTr6OGvEjXlU6hKXEO2c5Lm2zY,2386
5
- logger_36/logger_gpu.py,sha256=YYFk6aYQrBDJfxQaDm-ar16T6SlOSL6jJWTOgvpF4EU,2244
6
- logger_36/measure.py,sha256=P507VNbVKAf4jYGnGX-3rlDrVbrYP0ZD3nxFmAFvhyI,2404
7
- logger_36/storage.py,sha256=O8pDmiL0B3LJpKrhi8a9IMBXs6MwW6r1bMUn_cSDAaY,2246
8
- logger_36/version.py,sha256=R2K8-57Lahk2FjSCqX05d_TyRALChV-T1s0nHQifns8,2206
6
+ logger_36/memory.py,sha256=FTc3qCeMqnCNvHJ4Yds73noPENQx_U1MYB-R4LLUjVQ,2682
7
+ logger_36/storage.py,sha256=TNfIXEfHcjixv75wocUyqwX62iDYsor4srRqC3FNzbc,2231
8
+ logger_36/system.py,sha256=xzm6cMeTaCX9VX9ZRXUXgfqoT9oUtv3W2o_H2W0P-4Q,2243
9
+ logger_36/time.py,sha256=_CtpQeUZdsUNGNfwzhoWUiUvawRgmonqwZPHouzWf5M,2308
10
+ logger_36/version.py,sha256=C_q5mLo__HXHHvcfHIjNc1a_cFQMKdfy8MRQmswsFq8,2206
11
+ logger_36/api/logger.py,sha256=Wg2nzQeuRVZ4v-oy3Q2KdYsHSzF9v7a0Fk6BzLnbkYw,2225
12
+ logger_36/api/storage.py,sha256=evKVqIsslA5X82LaZ2HQDxp7ltyNOn8Tr-3-Pic3eUo,2231
9
13
  logger_36/catalog/config/console_rich.py,sha256=QDkgSs3I7ZULvkd1q4J1hdvgyB857JJcJWxM9fdL51Y,2883
10
14
  logger_36/catalog/handler/console.py,sha256=SF9S3CUoEPp5dh7RrqotywDJjMgRp0rD9sO3eLVXnkA,4004
11
15
  logger_36/catalog/handler/console_rich.py,sha256=uLZzVURQ6OIUuQEGMc142vJkEyxBbE0-HJJGQ_zOJcI,8914
@@ -36,13 +40,13 @@ logger_36/task/storage.py,sha256=XaSeu-iBCa0N8HNpwCV7cLprj-lbOJocpTIKUgSOvsc,566
36
40
  logger_36/task/format/memory.py,sha256=ECOdHjdxIqXivOwtcmwpLDMYUrutIeOTCn1L4d3-U8k,4241
37
41
  logger_36/task/format/message.py,sha256=HuV8we1mqh7Xcd4vbwoC0mJ8f_PjtP4sX3WFM6W7Oew,4420
38
42
  logger_36/task/format/rule.py,sha256=M4a8uW7FEvMI9f4s32A9-DoP0WVlLkyXamGnqbzZ65A,2797
39
- logger_36/task/measure/chronos.py,sha256=t-y0bVm1SmF-3wI9pR9Bp6-qzVlsE94fZTZr5a_hZUA,2884
43
+ logger_36/task/measure/chronos.py,sha256=PX7dESj0znstwAWW2tTQ5gcQuIlexzt1ZKcccyp-Ap0,2870
40
44
  logger_36/task/measure/memory.py,sha256=eVw5WOYLyn8o4O4mMArdX2MzsVuhhNDovjYEkk-MIaU,2504
41
45
  logger_36/type/handler.py,sha256=BXpevZhLq5V_IdUfi_LZA4czzlH2SGLpgvbqUBe5X10,8311
42
46
  logger_36/type/issue.py,sha256=Y7OCLCzVt6Yvkecwj8HXLdZjg33oMxexc9XkYHzUhh4,3202
43
- logger_36/type/logger.py,sha256=GClqeLtTCiItaIM0G29NNEETw765vA23npa4klOoydQ,17178
47
+ logger_36/type/logger.py,sha256=EM_wtwPSZW4pTvbHma1q2xXjhUpAa6Af67qBNt8Sq4Q,17386
44
48
  logger_36/type/loggers.py,sha256=znqxWBnfQxvkg3VUfbTUvt3S6Kq0DAzWWepxQDt9suI,2871
45
- logger_36-2024.24.dist-info/METADATA,sha256=B8cCu3tIwEJIFQ4nKmP-lP4AzaeBJCau_ns-bguXr-8,6276
46
- logger_36-2024.24.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
47
- logger_36-2024.24.dist-info/top_level.txt,sha256=sM95BTMWmslEEgR_1pzwZsOeSp8C_QBiu8ImbFr0XLc,10
48
- logger_36-2024.24.dist-info/RECORD,,
49
+ logger_36-2024.25.dist-info/METADATA,sha256=YgnEX7JnJeAoOseRKRuJtd2VRyDOJuUXy-Ovel_ywc0,6276
50
+ logger_36-2024.25.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
51
+ logger_36-2024.25.dist-info/top_level.txt,sha256=sM95BTMWmslEEgR_1pzwZsOeSp8C_QBiu8ImbFr0XLc,10
52
+ logger_36-2024.25.dist-info/RECORD,,
File without changes