logger-36 2024.15__py3-none-any.whl → 2024.17__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.
Files changed (45) hide show
  1. logger_36/__init__.py +54 -32
  2. logger_36/catalog/config/console_rich.py +58 -37
  3. logger_36/catalog/handler/console.py +64 -42
  4. logger_36/catalog/handler/console_rich.py +67 -45
  5. logger_36/catalog/handler/file.py +67 -45
  6. logger_36/catalog/handler/generic.py +72 -51
  7. logger_36/catalog/logging/chronos.py +56 -33
  8. logger_36/catalog/logging/exception.py +74 -0
  9. logger_36/catalog/logging/gpu.py +56 -33
  10. logger_36/catalog/logging/memory.py +66 -39
  11. logger_36/catalog/logging/system.py +56 -32
  12. logger_36/config/issue.py +51 -30
  13. logger_36/config/memory.py +51 -30
  14. logger_36/config/message.py +51 -30
  15. logger_36/config/system.py +51 -30
  16. logger_36/constant/error.py +51 -30
  17. logger_36/constant/generic.py +51 -30
  18. logger_36/constant/handler.py +51 -30
  19. logger_36/constant/issue.py +51 -30
  20. logger_36/constant/logger.py +51 -30
  21. logger_36/constant/memory.py +51 -30
  22. logger_36/constant/message.py +51 -30
  23. logger_36/constant/record.py +51 -30
  24. logger_36/constant/system.py +51 -30
  25. logger_36/instance/logger.py +55 -0
  26. logger_36/instance/loggers.py +56 -0
  27. logger_36/main.py +61 -33
  28. logger_36/task/format/memory.py +52 -30
  29. logger_36/task/format/message.py +52 -30
  30. logger_36/task/format/rule.py +51 -30
  31. logger_36/task/inspection.py +52 -30
  32. logger_36/task/measure/chronos.py +52 -30
  33. logger_36/task/measure/memory.py +52 -30
  34. logger_36/task/storage.py +60 -38
  35. logger_36/type/{extension.py → handler.py} +59 -37
  36. logger_36/type/issue.py +52 -30
  37. logger_36/type/logger.py +70 -51
  38. logger_36/type/loggers.py +78 -0
  39. logger_36/version.py +53 -32
  40. {logger_36-2024.15.dist-info → logger_36-2024.17.dist-info}/METADATA +50 -32
  41. logger_36-2024.17.dist-info/RECORD +43 -0
  42. {logger_36-2024.15.dist-info → logger_36-2024.17.dist-info}/WHEEL +1 -1
  43. logger_36/instance.py +0 -34
  44. logger_36-2024.15.dist-info/RECORD +0 -40
  45. {logger_36-2024.15.dist-info → logger_36-2024.17.dist-info}/top_level.txt +0 -0
@@ -1,33 +1,8 @@
1
- # Copyright CNRS/Inria/UniCA
2
- # Contributor(s): Eric Debreuve (since 2023)
3
- #
4
- # eric.debreuve@cnrs.fr
5
- #
6
- # This software is governed by the CeCILL license under French law and
7
- # abiding by the rules of distribution of free software. You can use,
8
- # modify and/ or redistribute the software under the terms of the CeCILL
9
- # license as circulated by CEA, CNRS and INRIA at the following URL
10
- # "http://www.cecill.info".
11
- #
12
- # As a counterpart to the access to the source code and rights to copy,
13
- # modify and redistribute granted by the license, users are provided only
14
- # with a limited warranty and the software's author, the holder of the
15
- # economic rights, and the successive licensors have only limited
16
- # liability.
17
- #
18
- # In this respect, the user's attention is drawn to the risks associated
19
- # with loading, using, modifying and/or developing or reproducing the
20
- # software by the user in light of its specific status of free software,
21
- # that may mean that it is complicated to manipulate, and that also
22
- # therefore means that it is reserved for developers and experienced
23
- # professionals having in-depth computer knowledge. Users are therefore
24
- # encouraged to load and test the software's suitability as regards their
25
- # requirements in conditions enabling the security of their systems and/or
26
- # data to be ensured and, more generally, to use and operate it in the
27
- # same conditions as regards security.
28
- #
29
- # The fact that you are presently reading this means that you have had
30
- # knowledge of the CeCILL license and that you accept its terms.
1
+ """
2
+ Copyright CNRS/Inria/UniCA
3
+ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
4
+ SEE COPYRIGHT NOTICE BELOW
5
+ """
31
6
 
32
7
  try:
33
8
  from psutil import Process as process_t
@@ -48,3 +23,50 @@ def CurrentUsage() -> int:
48
23
  return -1
49
24
 
50
25
  return _PROCESS.memory_info().rss
26
+
27
+
28
+ """
29
+ COPYRIGHT NOTICE
30
+
31
+ This software is governed by the CeCILL license under French law and
32
+ abiding by the rules of distribution of free software. You can use,
33
+ modify and/ or redistribute the software under the terms of the CeCILL
34
+ license as circulated by CEA, CNRS and INRIA at the following URL
35
+ "http://www.cecill.info".
36
+
37
+ As a counterpart to the access to the source code and rights to copy,
38
+ modify and redistribute granted by the license, users are provided only
39
+ with a limited warranty and the software's author, the holder of the
40
+ economic rights, and the successive licensors have only limited
41
+ liability.
42
+
43
+ In this respect, the user's attention is drawn to the risks associated
44
+ with loading, using, modifying and/or developing or reproducing the
45
+ software by the user in light of its specific status of free software,
46
+ that may mean that it is complicated to manipulate, and that also
47
+ therefore means that it is reserved for developers and experienced
48
+ professionals having in-depth computer knowledge. Users are therefore
49
+ encouraged to load and test the software's suitability as regards their
50
+ requirements in conditions enabling the security of their systems and/or
51
+ data to be ensured and, more generally, to use and operate it in the
52
+ same conditions as regards security.
53
+
54
+ The fact that you are presently reading this means that you have had
55
+ knowledge of the CeCILL license and that you accept its terms.
56
+
57
+ SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
58
+
59
+ This software is being developed by Eric Debreuve, a CNRS employee and
60
+ member of team Morpheme.
61
+ Team Morpheme is a joint team between Inria, CNRS, and UniCA.
62
+ It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
63
+ I3S, and Laboratory iBV.
64
+
65
+ CNRS: https://www.cnrs.fr/index.php/en
66
+ Inria: https://www.inria.fr/en/
67
+ UniCA: https://univ-cotedazur.eu/
68
+ Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
69
+ I3S: https://www.i3s.unice.fr/en/
70
+ iBV: http://ibv.unice.fr/
71
+ Team Morpheme: https://team.inria.fr/morpheme/
72
+ """
logger_36/task/storage.py CHANGED
@@ -1,35 +1,10 @@
1
- # Copyright CNRS/Inria/UniCA
2
- # Contributor(s): Eric Debreuve (since 2023)
3
- #
4
- # eric.debreuve@cnrs.fr
5
- #
6
- # This software is governed by the CeCILL license under French law and
7
- # abiding by the rules of distribution of free software. You can use,
8
- # modify and/ or redistribute the software under the terms of the CeCILL
9
- # license as circulated by CEA, CNRS and INRIA at the following URL
10
- # "http://www.cecill.info".
11
- #
12
- # As a counterpart to the access to the source code and rights to copy,
13
- # modify and redistribute granted by the license, users are provided only
14
- # with a limited warranty and the software's author, the holder of the
15
- # economic rights, and the successive licensors have only limited
16
- # liability.
17
- #
18
- # In this respect, the user's attention is drawn to the risks associated
19
- # with loading, using, modifying and/or developing or reproducing the
20
- # software by the user in light of its specific status of free software,
21
- # that may mean that it is complicated to manipulate, and that also
22
- # therefore means that it is reserved for developers and experienced
23
- # professionals having in-depth computer knowledge. Users are therefore
24
- # encouraged to load and test the software's suitability as regards their
25
- # requirements in conditions enabling the security of their systems and/or
26
- # data to be ensured and, more generally, to use and operate it in the
27
- # same conditions as regards security.
28
- #
29
- # The fact that you are presently reading this means that you have had
30
- # knowledge of the CeCILL license and that you accept its terms.
31
-
32
- import dataclasses as dtcl
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 dataclasses as d
33
8
  import logging as lggg
34
9
  import re as regx
35
10
  import typing as h
@@ -41,18 +16,18 @@ try:
41
16
  except ModuleNotFoundError:
42
17
  console_t = None
43
18
 
44
- from logger_36.instance import LOGGER
19
+ from logger_36.instance.logger import LOGGER
45
20
 
46
21
  _BODY_END_PATTERN = r"</[bB][oO][dD][yY]>(.|\n)*$"
47
22
 
48
23
 
49
- @dtcl.dataclass(slots=True, repr=False, eq=False)
24
+ @d.dataclass(slots=True, repr=False, eq=False)
50
25
  class html_reader_t(html_parser_t):
51
26
  source: str = ""
52
- inside_body: bool = dtcl.field(init=False, default=False)
53
- body_position_start: tuple[int, int] = dtcl.field(init=False, default=(-1, -1))
54
- body_position_end: tuple[int, int] = dtcl.field(init=False, default=(-1, -1))
55
- pieces: list[str] = dtcl.field(init=False, default_factory=list)
27
+ inside_body: bool = d.field(init=False, default=False)
28
+ body_position_start: tuple[int, int] = d.field(init=False, default=(-1, -1))
29
+ body_position_end: tuple[int, int] = d.field(init=False, default=(-1, -1))
30
+ pieces: list[str] = d.field(init=False, default_factory=list)
56
31
 
57
32
  def __post_init__(self) -> None:
58
33
  """"""
@@ -142,3 +117,50 @@ def SaveLOGasHTML(path: str | path_t | h.TextIO = None) -> None:
142
117
  path.write(html)
143
118
  else:
144
119
  LOGGER.warning(f"{cannot_save}: No handler has a RICH console.")
120
+
121
+
122
+ """
123
+ COPYRIGHT NOTICE
124
+
125
+ This software is governed by the CeCILL license under French law and
126
+ abiding by the rules of distribution of free software. You can use,
127
+ modify and/ or redistribute the software under the terms of the CeCILL
128
+ license as circulated by CEA, CNRS and INRIA at the following URL
129
+ "http://www.cecill.info".
130
+
131
+ As a counterpart to the access to the source code and rights to copy,
132
+ modify and redistribute granted by the license, users are provided only
133
+ with a limited warranty and the software's author, the holder of the
134
+ economic rights, and the successive licensors have only limited
135
+ liability.
136
+
137
+ In this respect, the user's attention is drawn to the risks associated
138
+ with loading, using, modifying and/or developing or reproducing the
139
+ software by the user in light of its specific status of free software,
140
+ that may mean that it is complicated to manipulate, and that also
141
+ therefore means that it is reserved for developers and experienced
142
+ professionals having in-depth computer knowledge. Users are therefore
143
+ encouraged to load and test the software's suitability as regards their
144
+ requirements in conditions enabling the security of their systems and/or
145
+ data to be ensured and, more generally, to use and operate it in the
146
+ same conditions as regards security.
147
+
148
+ The fact that you are presently reading this means that you have had
149
+ knowledge of the CeCILL license and that you accept its terms.
150
+
151
+ SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
152
+
153
+ This software is being developed by Eric Debreuve, a CNRS employee and
154
+ member of team Morpheme.
155
+ Team Morpheme is a joint team between Inria, CNRS, and UniCA.
156
+ It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
157
+ I3S, and Laboratory iBV.
158
+
159
+ CNRS: https://www.cnrs.fr/index.php/en
160
+ Inria: https://www.inria.fr/en/
161
+ UniCA: https://univ-cotedazur.eu/
162
+ Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
163
+ I3S: https://www.i3s.unice.fr/en/
164
+ iBV: http://ibv.unice.fr/
165
+ Team Morpheme: https://team.inria.fr/morpheme/
166
+ """
@@ -1,35 +1,10 @@
1
- # Copyright CNRS/Inria/UniCA
2
- # Contributor(s): Eric Debreuve (since 2023)
3
- #
4
- # eric.debreuve@cnrs.fr
5
- #
6
- # This software is governed by the CeCILL license under French law and
7
- # abiding by the rules of distribution of free software. You can use,
8
- # modify and/ or redistribute the software under the terms of the CeCILL
9
- # license as circulated by CEA, CNRS and INRIA at the following URL
10
- # "http://www.cecill.info".
11
- #
12
- # As a counterpart to the access to the source code and rights to copy,
13
- # modify and redistribute granted by the license, users are provided only
14
- # with a limited warranty and the software's author, the holder of the
15
- # economic rights, and the successive licensors have only limited
16
- # liability.
17
- #
18
- # In this respect, the user's attention is drawn to the risks associated
19
- # with loading, using, modifying and/or developing or reproducing the
20
- # software by the user in light of its specific status of free software,
21
- # that may mean that it is complicated to manipulate, and that also
22
- # therefore means that it is reserved for developers and experienced
23
- # professionals having in-depth computer knowledge. Users are therefore
24
- # encouraged to load and test the software's suitability as regards their
25
- # requirements in conditions enabling the security of their systems and/or
26
- # data to be ensured and, more generally, to use and operate it in the
27
- # same conditions as regards security.
28
- #
29
- # The fact that you are presently reading this means that you have had
30
- # knowledge of the CeCILL license and that you accept its terms.
31
-
32
- import dataclasses as dtcl
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 dataclasses as d
33
8
  import logging as lggg
34
9
  import sys as sstm
35
10
  import typing as h
@@ -48,17 +23,17 @@ from logger_36.task.measure.memory import CanCheckMemory
48
23
  _MEMORY_MEASURE_ERROR = MEMORY_MEASURE_ERROR
49
24
 
50
25
 
51
- @dtcl.dataclass(slots=True, repr=False, eq=False)
26
+ @d.dataclass(slots=True, repr=False, eq=False)
52
27
  class handler_extension_t:
53
28
  name: str | None = None
54
29
  show_where: bool = True
55
30
  show_memory_usage: bool = False
56
31
  message_width: int = -1
57
- FormattedRecord: h.Callable[[lggg.LogRecord], str] = dtcl.field(init=False)
32
+ FormattedRecord: h.Callable[[lggg.LogRecord], str] = d.field(init=False)
58
33
 
59
- handler: dtcl.InitVar[lggg.Handler | None] = None
60
- level: dtcl.InitVar[int] = lggg.NOTSET
61
- formatter: dtcl.InitVar[lggg.Formatter | None] = None
34
+ handler: d.InitVar[lggg.Handler | None] = None
35
+ level: d.InitVar[int] = lggg.NOTSET
36
+ formatter: d.InitVar[lggg.Formatter | None] = None
62
37
 
63
38
  def __post_init__(
64
39
  self, handler: lggg.Handler | None, level: int, formatter: lggg.Formatter | None
@@ -199,3 +174,50 @@ def _WrappedLines(lines: list[str], message_width: int, /) -> list[str]:
199
174
  output.append(line)
200
175
 
201
176
  return output
177
+
178
+
179
+ """
180
+ COPYRIGHT NOTICE
181
+
182
+ This software is governed by the CeCILL license under French law and
183
+ abiding by the rules of distribution of free software. You can use,
184
+ modify and/ or redistribute the software under the terms of the CeCILL
185
+ license as circulated by CEA, CNRS and INRIA at the following URL
186
+ "http://www.cecill.info".
187
+
188
+ As a counterpart to the access to the source code and rights to copy,
189
+ modify and redistribute granted by the license, users are provided only
190
+ with a limited warranty and the software's author, the holder of the
191
+ economic rights, and the successive licensors have only limited
192
+ liability.
193
+
194
+ In this respect, the user's attention is drawn to the risks associated
195
+ with loading, using, modifying and/or developing or reproducing the
196
+ software by the user in light of its specific status of free software,
197
+ that may mean that it is complicated to manipulate, and that also
198
+ therefore means that it is reserved for developers and experienced
199
+ professionals having in-depth computer knowledge. Users are therefore
200
+ encouraged to load and test the software's suitability as regards their
201
+ requirements in conditions enabling the security of their systems and/or
202
+ data to be ensured and, more generally, to use and operate it in the
203
+ same conditions as regards security.
204
+
205
+ The fact that you are presently reading this means that you have had
206
+ knowledge of the CeCILL license and that you accept its terms.
207
+
208
+ SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
209
+
210
+ This software is being developed by Eric Debreuve, a CNRS employee and
211
+ member of team Morpheme.
212
+ Team Morpheme is a joint team between Inria, CNRS, and UniCA.
213
+ It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
214
+ I3S, and Laboratory iBV.
215
+
216
+ CNRS: https://www.cnrs.fr/index.php/en
217
+ Inria: https://www.inria.fr/en/
218
+ UniCA: https://univ-cotedazur.eu/
219
+ Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
220
+ I3S: https://www.i3s.unice.fr/en/
221
+ iBV: http://ibv.unice.fr/
222
+ Team Morpheme: https://team.inria.fr/morpheme/
223
+ """
logger_36/type/issue.py CHANGED
@@ -1,33 +1,8 @@
1
- # Copyright CNRS/Inria/UniCA
2
- # Contributor(s): Eric Debreuve (since 2023)
3
- #
4
- # eric.debreuve@cnrs.fr
5
- #
6
- # This software is governed by the CeCILL license under French law and
7
- # abiding by the rules of distribution of free software. You can use,
8
- # modify and/ or redistribute the software under the terms of the CeCILL
9
- # license as circulated by CEA, CNRS and INRIA at the following URL
10
- # "http://www.cecill.info".
11
- #
12
- # As a counterpart to the access to the source code and rights to copy,
13
- # modify and redistribute granted by the license, users are provided only
14
- # with a limited warranty and the software's author, the holder of the
15
- # economic rights, and the successive licensors have only limited
16
- # liability.
17
- #
18
- # In this respect, the user's attention is drawn to the risks associated
19
- # with loading, using, modifying and/or developing or reproducing the
20
- # software by the user in light of its specific status of free software,
21
- # that may mean that it is complicated to manipulate, and that also
22
- # therefore means that it is reserved for developers and experienced
23
- # professionals having in-depth computer knowledge. Users are therefore
24
- # encouraged to load and test the software's suitability as regards their
25
- # requirements in conditions enabling the security of their systems and/or
26
- # data to be ensured and, more generally, to use and operate it in the
27
- # same conditions as regards security.
28
- #
29
- # The fact that you are presently reading this means that you have had
30
- # knowledge of the CeCILL license and that you accept its terms.
1
+ """
2
+ Copyright CNRS/Inria/UniCA
3
+ Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
4
+ SEE COPYRIGHT NOTICE BELOW
5
+ """
31
6
 
32
7
  import typing as h
33
8
 
@@ -62,3 +37,50 @@ def NewIssue(
62
37
  )
63
38
 
64
39
  return f"{context}{separator}{message}"
40
+
41
+
42
+ """
43
+ COPYRIGHT NOTICE
44
+
45
+ This software is governed by the CeCILL license under French law and
46
+ abiding by the rules of distribution of free software. You can use,
47
+ modify and/ or redistribute the software under the terms of the CeCILL
48
+ license as circulated by CEA, CNRS and INRIA at the following URL
49
+ "http://www.cecill.info".
50
+
51
+ As a counterpart to the access to the source code and rights to copy,
52
+ modify and redistribute granted by the license, users are provided only
53
+ with a limited warranty and the software's author, the holder of the
54
+ economic rights, and the successive licensors have only limited
55
+ liability.
56
+
57
+ In this respect, the user's attention is drawn to the risks associated
58
+ with loading, using, modifying and/or developing or reproducing the
59
+ software by the user in light of its specific status of free software,
60
+ that may mean that it is complicated to manipulate, and that also
61
+ therefore means that it is reserved for developers and experienced
62
+ professionals having in-depth computer knowledge. Users are therefore
63
+ encouraged to load and test the software's suitability as regards their
64
+ requirements in conditions enabling the security of their systems and/or
65
+ data to be ensured and, more generally, to use and operate it in the
66
+ same conditions as regards security.
67
+
68
+ The fact that you are presently reading this means that you have had
69
+ knowledge of the CeCILL license and that you accept its terms.
70
+
71
+ SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
72
+
73
+ This software is being developed by Eric Debreuve, a CNRS employee and
74
+ member of team Morpheme.
75
+ Team Morpheme is a joint team between Inria, CNRS, and UniCA.
76
+ It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
77
+ I3S, and Laboratory iBV.
78
+
79
+ CNRS: https://www.cnrs.fr/index.php/en
80
+ Inria: https://www.inria.fr/en/
81
+ UniCA: https://univ-cotedazur.eu/
82
+ Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
83
+ I3S: https://www.i3s.unice.fr/en/
84
+ iBV: http://ibv.unice.fr/
85
+ Team Morpheme: https://team.inria.fr/morpheme/
86
+ """
logger_36/type/logger.py CHANGED
@@ -1,37 +1,10 @@
1
- # Copyright CNRS/Inria/UniCA
2
- # Contributor(s): Eric Debreuve (since 2023)
3
- #
4
- # eric.debreuve@cnrs.fr
5
- #
6
- # This software is governed by the CeCILL license under French law and
7
- # abiding by the rules of distribution of free software. You can use,
8
- # modify and/ or redistribute the software under the terms of the CeCILL
9
- # license as circulated by CEA, CNRS and INRIA at the following URL
10
- # "http://www.cecill.info".
11
- #
12
- # As a counterpart to the access to the source code and rights to copy,
13
- # modify and redistribute granted by the license, users are provided only
14
- # with a limited warranty and the software's author, the holder of the
15
- # economic rights, and the successive licensors have only limited
16
- # liability.
17
- #
18
- # In this respect, the user's attention is drawn to the risks associated
19
- # with loading, using, modifying and/or developing or reproducing the
20
- # software by the user in light of its specific status of free software,
21
- # that may mean that it is complicated to manipulate, and that also
22
- # therefore means that it is reserved for developers and experienced
23
- # professionals having in-depth computer knowledge. Users are therefore
24
- # encouraged to load and test the software's suitability as regards their
25
- # requirements in conditions enabling the security of their systems and/or
26
- # data to be ensured and, more generally, to use and operate it in the
27
- # same conditions as regards security.
28
- #
29
- # The fact that you are presently reading this means that you have had
30
- # knowledge of the CeCILL license and that you accept its terms.
31
-
32
- from __future__ import annotations
33
-
34
- import dataclasses as dtcl
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 dataclasses as d
35
8
  import logging as lggg
36
9
  import sys as sstm
37
10
  import traceback as tbck
@@ -64,33 +37,31 @@ from logger_36.task.measure.memory import CurrentUsage as CurrentMemoryUsage
64
37
  from logger_36.type.issue import NewIssue, issue_t
65
38
 
66
39
 
67
- @dtcl.dataclass(slots=True, repr=False, eq=False)
40
+ @d.dataclass(slots=True, repr=False, eq=False)
68
41
  class logger_t(lggg.Logger):
69
- name: dtcl.InitVar[str] = LOGGER_NAME
70
- level: dtcl.InitVar[int] = lggg.NOTSET
71
- activate_wrn_interceptions: dtcl.InitVar[bool] = True
42
+ name_: d.InitVar[str] = LOGGER_NAME
43
+ level: d.InitVar[int] = lggg.NOTSET
44
+ activate_wrn_interceptions: d.InitVar[bool] = True
72
45
  exit_on_error: bool = False
73
46
  # Must not be False until at least one handler has been added.
74
47
  should_hold_messages: bool = True
75
48
 
76
- on_hold: list[lggg.LogRecord] = dtcl.field(init=False, default_factory=list)
77
- last_message_date: str = dtcl.field(init=False, default="")
78
- any_handler_shows_memory: bool = dtcl.field(init=False, default=False)
79
- memory_usages: list[tuple[str, int]] = dtcl.field(init=False, default_factory=list)
80
- context_levels: list[str] = dtcl.field(init=False, default_factory=list)
81
- staged_issues: list[issue_t] = dtcl.field(init=False, default_factory=list)
82
- intercepted_wrn_handle: logger_handle_h | None = dtcl.field(
83
- init=False, default=None
84
- )
85
- intercepted_log_handles: dict[str, logger_handle_h] = dtcl.field(
49
+ on_hold: list[lggg.LogRecord] = d.field(init=False, default_factory=list)
50
+ last_message_date: str = d.field(init=False, default="")
51
+ any_handler_shows_memory: bool = d.field(init=False, default=False)
52
+ memory_usages: list[tuple[str, int]] = d.field(init=False, default_factory=list)
53
+ context_levels: list[str] = d.field(init=False, default_factory=list)
54
+ staged_issues: list[issue_t] = d.field(init=False, default_factory=list)
55
+ intercepted_wrn_handle: logger_handle_h | None = d.field(init=False, default=None)
56
+ intercepted_log_handles: dict[str, logger_handle_h] = d.field(
86
57
  init=False, default_factory=dict
87
58
  )
88
59
 
89
60
  def __post_init__(
90
- self, name: str, level: int, activate_wrn_interceptions: bool
61
+ self, name_: str, level: int, activate_wrn_interceptions: bool
91
62
  ) -> None:
92
63
  """"""
93
- lggg.Logger.__init__(self, name)
64
+ lggg.Logger.__init__(self, name_)
94
65
  self.setLevel(level)
95
66
  self.propagate = False
96
67
 
@@ -247,7 +218,7 @@ class logger_t(lggg.Logger):
247
218
  """"""
248
219
  self.context_levels.append(new_level)
249
220
 
250
- def AddedContextLevel(self, new_level: str, /) -> logger_t:
221
+ def AddedContextLevel(self, new_level: str, /) -> h.Self:
251
222
  """
252
223
  Meant to be used as:
253
224
  with self.AddedContextLevel("new level"):
@@ -322,6 +293,7 @@ class logger_t(lggg.Logger):
322
293
  print("\n".join(lines), file=sstm.stderr)
323
294
  sstm.exit(1)
324
295
 
296
+ level: int
325
297
  self.log(level, issues, stacklevel=2)
326
298
  self.staged_issues.clear()
327
299
 
@@ -387,3 +359,50 @@ def _HandleForInterceptions(
387
359
  interceptor.handle(duplicate)
388
360
 
389
361
  return handle_p
362
+
363
+
364
+ """
365
+ COPYRIGHT NOTICE
366
+
367
+ This software is governed by the CeCILL license under French law and
368
+ abiding by the rules of distribution of free software. You can use,
369
+ modify and/ or redistribute the software under the terms of the CeCILL
370
+ license as circulated by CEA, CNRS and INRIA at the following URL
371
+ "http://www.cecill.info".
372
+
373
+ As a counterpart to the access to the source code and rights to copy,
374
+ modify and redistribute granted by the license, users are provided only
375
+ with a limited warranty and the software's author, the holder of the
376
+ economic rights, and the successive licensors have only limited
377
+ liability.
378
+
379
+ In this respect, the user's attention is drawn to the risks associated
380
+ with loading, using, modifying and/or developing or reproducing the
381
+ software by the user in light of its specific status of free software,
382
+ that may mean that it is complicated to manipulate, and that also
383
+ therefore means that it is reserved for developers and experienced
384
+ professionals having in-depth computer knowledge. Users are therefore
385
+ encouraged to load and test the software's suitability as regards their
386
+ requirements in conditions enabling the security of their systems and/or
387
+ data to be ensured and, more generally, to use and operate it in the
388
+ same conditions as regards security.
389
+
390
+ The fact that you are presently reading this means that you have had
391
+ knowledge of the CeCILL license and that you accept its terms.
392
+
393
+ SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
394
+
395
+ This software is being developed by Eric Debreuve, a CNRS employee and
396
+ member of team Morpheme.
397
+ Team Morpheme is a joint team between Inria, CNRS, and UniCA.
398
+ It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
399
+ I3S, and Laboratory iBV.
400
+
401
+ CNRS: https://www.cnrs.fr/index.php/en
402
+ Inria: https://www.inria.fr/en/
403
+ UniCA: https://univ-cotedazur.eu/
404
+ Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
405
+ I3S: https://www.i3s.unice.fr/en/
406
+ iBV: http://ibv.unice.fr/
407
+ Team Morpheme: https://team.inria.fr/morpheme/
408
+ """
@@ -0,0 +1,78 @@
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 dataclasses as d
8
+ import typing as h
9
+
10
+ from logger_36.type.logger import logger_t
11
+
12
+
13
+ @d.dataclass(slots=True, repr=False, eq=False)
14
+ class loggers_t(dict[h.Hashable, logger_t]):
15
+ active: logger_t | None = d.field(init=False, default=None)
16
+
17
+ def AddNew(self, uid: h.Hashable, /) -> None:
18
+ """"""
19
+ self.Add(uid, logger_t())
20
+
21
+ def Add(self, uid: h.Hashable, logger: logger_t, /) -> None:
22
+ """"""
23
+ if uid in self:
24
+ raise NameError(f"Logger with name/identity {uid} already exists.")
25
+
26
+ self[uid] = logger
27
+ self.active = logger
28
+
29
+ def SetActive(self, uid: h.Hashable, /) -> None:
30
+ """"""
31
+ self.active = self[uid]
32
+
33
+
34
+ """
35
+ COPYRIGHT NOTICE
36
+
37
+ This software is governed by the CeCILL license under French law and
38
+ abiding by the rules of distribution of free software. You can use,
39
+ modify and/ or redistribute the software under the terms of the CeCILL
40
+ license as circulated by CEA, CNRS and INRIA at the following URL
41
+ "http://www.cecill.info".
42
+
43
+ As a counterpart to the access to the source code and rights to copy,
44
+ modify and redistribute granted by the license, users are provided only
45
+ with a limited warranty and the software's author, the holder of the
46
+ economic rights, and the successive licensors have only limited
47
+ liability.
48
+
49
+ In this respect, the user's attention is drawn to the risks associated
50
+ with loading, using, modifying and/or developing or reproducing the
51
+ software by the user in light of its specific status of free software,
52
+ that may mean that it is complicated to manipulate, and that also
53
+ therefore means that it is reserved for developers and experienced
54
+ professionals having in-depth computer knowledge. Users are therefore
55
+ encouraged to load and test the software's suitability as regards their
56
+ requirements in conditions enabling the security of their systems and/or
57
+ data to be ensured and, more generally, to use and operate it in the
58
+ same conditions as regards security.
59
+
60
+ The fact that you are presently reading this means that you have had
61
+ knowledge of the CeCILL license and that you accept its terms.
62
+
63
+ SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
64
+
65
+ This software is being developed by Eric Debreuve, a CNRS employee and
66
+ member of team Morpheme.
67
+ Team Morpheme is a joint team between Inria, CNRS, and UniCA.
68
+ It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
69
+ I3S, and Laboratory iBV.
70
+
71
+ CNRS: https://www.cnrs.fr/index.php/en
72
+ Inria: https://www.inria.fr/en/
73
+ UniCA: https://univ-cotedazur.eu/
74
+ Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
75
+ I3S: https://www.i3s.unice.fr/en/
76
+ iBV: http://ibv.unice.fr/
77
+ Team Morpheme: https://team.inria.fr/morpheme/
78
+ """