logger-36 2024.15__py3-none-any.whl → 2024.16__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 +54 -32
- logger_36/catalog/config/console_rich.py +58 -37
- logger_36/catalog/handler/console.py +64 -42
- logger_36/catalog/handler/console_rich.py +67 -45
- logger_36/catalog/handler/file.py +67 -45
- logger_36/catalog/handler/generic.py +72 -51
- logger_36/catalog/logging/chronos.py +56 -33
- logger_36/catalog/logging/exception.py +74 -0
- logger_36/catalog/logging/gpu.py +56 -33
- logger_36/catalog/logging/memory.py +66 -39
- logger_36/catalog/logging/system.py +56 -32
- logger_36/config/issue.py +51 -30
- logger_36/config/memory.py +51 -30
- logger_36/config/message.py +51 -30
- logger_36/config/system.py +51 -30
- logger_36/constant/error.py +51 -30
- logger_36/constant/generic.py +51 -30
- logger_36/constant/handler.py +51 -30
- logger_36/constant/issue.py +51 -30
- logger_36/constant/logger.py +51 -30
- logger_36/constant/memory.py +51 -30
- logger_36/constant/message.py +51 -30
- logger_36/constant/record.py +51 -30
- logger_36/constant/system.py +64 -36
- logger_36/instance/logger.py +55 -0
- logger_36/instance/loggers.py +56 -0
- logger_36/main.py +61 -33
- logger_36/task/format/memory.py +52 -30
- logger_36/task/format/message.py +52 -30
- logger_36/task/format/rule.py +51 -30
- logger_36/task/inspection.py +52 -30
- logger_36/task/measure/chronos.py +52 -30
- logger_36/task/measure/memory.py +52 -30
- logger_36/task/storage.py +60 -38
- logger_36/type/{extension.py → handler.py} +59 -37
- logger_36/type/issue.py +52 -30
- logger_36/type/logger.py +70 -51
- logger_36/type/loggers.py +78 -0
- logger_36/version.py +53 -32
- {logger_36-2024.15.dist-info → logger_36-2024.16.dist-info}/METADATA +48 -30
- logger_36-2024.16.dist-info/RECORD +43 -0
- {logger_36-2024.15.dist-info → logger_36-2024.16.dist-info}/WHEEL +1 -1
- logger_36/instance.py +0 -34
- logger_36-2024.15.dist-info/RECORD +0 -40
- {logger_36-2024.15.dist-info → logger_36-2024.16.dist-info}/top_level.txt +0 -0
@@ -1,33 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
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 time
|
33
8
|
from datetime import datetime as dttm
|
@@ -55,3 +30,50 @@ def ElapsedTime() -> str:
|
|
55
30
|
output = output.split(maxsplit=1)[-1]
|
56
31
|
|
57
32
|
return output
|
33
|
+
|
34
|
+
|
35
|
+
"""
|
36
|
+
COPYRIGHT NOTICE
|
37
|
+
|
38
|
+
This software is governed by the CeCILL license under French law and
|
39
|
+
abiding by the rules of distribution of free software. You can use,
|
40
|
+
modify and/ or redistribute the software under the terms of the CeCILL
|
41
|
+
license as circulated by CEA, CNRS and INRIA at the following URL
|
42
|
+
"http://www.cecill.info".
|
43
|
+
|
44
|
+
As a counterpart to the access to the source code and rights to copy,
|
45
|
+
modify and redistribute granted by the license, users are provided only
|
46
|
+
with a limited warranty and the software's author, the holder of the
|
47
|
+
economic rights, and the successive licensors have only limited
|
48
|
+
liability.
|
49
|
+
|
50
|
+
In this respect, the user's attention is drawn to the risks associated
|
51
|
+
with loading, using, modifying and/or developing or reproducing the
|
52
|
+
software by the user in light of its specific status of free software,
|
53
|
+
that may mean that it is complicated to manipulate, and that also
|
54
|
+
therefore means that it is reserved for developers and experienced
|
55
|
+
professionals having in-depth computer knowledge. Users are therefore
|
56
|
+
encouraged to load and test the software's suitability as regards their
|
57
|
+
requirements in conditions enabling the security of their systems and/or
|
58
|
+
data to be ensured and, more generally, to use and operate it in the
|
59
|
+
same conditions as regards security.
|
60
|
+
|
61
|
+
The fact that you are presently reading this means that you have had
|
62
|
+
knowledge of the CeCILL license and that you accept its terms.
|
63
|
+
|
64
|
+
SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
|
65
|
+
|
66
|
+
This software is being developed by Eric Debreuve, a CNRS employee and
|
67
|
+
member of team Morpheme.
|
68
|
+
Team Morpheme is a joint team between Inria, CNRS, and UniCA.
|
69
|
+
It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
|
70
|
+
I3S, and Laboratory iBV.
|
71
|
+
|
72
|
+
CNRS: https://www.cnrs.fr/index.php/en
|
73
|
+
Inria: https://www.inria.fr/en/
|
74
|
+
UniCA: https://univ-cotedazur.eu/
|
75
|
+
Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
|
76
|
+
I3S: https://www.i3s.unice.fr/en/
|
77
|
+
iBV: http://ibv.unice.fr/
|
78
|
+
Team Morpheme: https://team.inria.fr/morpheme/
|
79
|
+
"""
|
logger_36/task/measure/memory.py
CHANGED
@@ -1,33 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
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
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
-
@
|
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 =
|
53
|
-
body_position_start: tuple[int, int] =
|
54
|
-
body_position_end: tuple[int, int] =
|
55
|
-
pieces: list[str] =
|
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
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
-
@
|
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] =
|
32
|
+
FormattedRecord: h.Callable[[lggg.LogRecord], str] = d.field(init=False)
|
58
33
|
|
59
|
-
handler:
|
60
|
-
level:
|
61
|
-
formatter:
|
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
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
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
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
-
@
|
40
|
+
@d.dataclass(slots=True, repr=False, eq=False)
|
68
41
|
class logger_t(lggg.Logger):
|
69
|
-
|
70
|
-
level:
|
71
|
-
activate_wrn_interceptions:
|
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] =
|
77
|
-
last_message_date: str =
|
78
|
-
any_handler_shows_memory: bool =
|
79
|
-
memory_usages: list[tuple[str, int]] =
|
80
|
-
context_levels: list[str] =
|
81
|
-
staged_issues: list[issue_t] =
|
82
|
-
intercepted_wrn_handle: logger_handle_h | None =
|
83
|
-
|
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,
|
61
|
+
self, name_: str, level: int, activate_wrn_interceptions: bool
|
91
62
|
) -> None:
|
92
63
|
""""""
|
93
|
-
lggg.Logger.__init__(self,
|
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, /) ->
|
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
|
+
"""
|