logger-36 2024.1__py3-none-any.whl → 2025.3__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- logger_36/__init__.py +64 -42
- logger_36/api/logger.py +53 -0
- logger_36/api/storage.py +53 -0
- logger_36/catalog/config/console_rich.py +76 -0
- logger_36/catalog/handler/console.py +117 -0
- logger_36/catalog/handler/console_rich.py +235 -0
- logger_36/catalog/handler/file.py +128 -0
- logger_36/catalog/handler/generic.py +228 -0
- logger_36/catalog/logger/chronos.py +61 -0
- logger_36/catalog/logger/gpu.py +90 -0
- logger_36/catalog/logger/memory.py +129 -0
- logger_36/catalog/logger/system.py +84 -0
- logger_36/config/issue.py +56 -0
- logger_36/config/logger.py +103 -0
- logger_36/config/memory.py +54 -0
- logger_36/config/message.py +66 -0
- logger_36/config/system.py +70 -0
- logger_36/constant/error.py +70 -0
- logger_36/constant/generic.py +58 -0
- logger_36/constant/handler.py +58 -0
- logger_36/constant/issue.py +58 -0
- logger_36/constant/logger.py +67 -0
- logger_36/constant/memory.py +58 -0
- logger_36/constant/message.py +72 -0
- logger_36/constant/record.py +55 -0
- logger_36/constant/system.py +60 -0
- logger_36/content.py +55 -0
- logger_36/exception.py +105 -0
- logger_36/gpu.py +53 -0
- logger_36/handler.py +209 -0
- logger_36/instance/logger.py +55 -0
- logger_36/instance/loggers.py +56 -0
- logger_36/memory.py +60 -0
- logger_36/storage.py +53 -0
- logger_36/system.py +53 -0
- logger_36/task/format/memory.py +132 -0
- logger_36/task/format/message.py +111 -0
- logger_36/task/format/rule.py +74 -0
- logger_36/task/inspection.py +70 -48
- logger_36/task/measure/chronos.py +84 -0
- logger_36/task/measure/memory.py +72 -0
- logger_36/task/storage.py +127 -46
- logger_36/time.py +54 -0
- logger_36/type/handler.py +184 -0
- logger_36/type/issue.py +91 -0
- logger_36/type/logger.py +542 -0
- logger_36/type/loggers.py +78 -0
- logger_36/version.py +53 -32
- logger_36-2025.3.dist-info/METADATA +154 -0
- logger_36-2025.3.dist-info/RECORD +52 -0
- {logger_36-2024.1.dist-info → logger_36-2025.3.dist-info}/WHEEL +1 -1
- logger_36/catalog/gpu.py +0 -56
- logger_36/catalog/memory.py +0 -109
- logger_36/catalog/system.py +0 -84
- logger_36/config.py +0 -48
- logger_36/constant.py +0 -52
- logger_36/instance.py +0 -34
- logger_36/main.py +0 -96
- logger_36/measure/chronos.py +0 -55
- logger_36/measure/memory.py +0 -50
- logger_36/type/console.py +0 -122
- logger_36/type/extension.py +0 -122
- logger_36/type/file.py +0 -52
- logger_36/type/generic.py +0 -115
- logger_36-2024.1.dist-info/METADATA +0 -106
- logger_36-2024.1.dist-info/RECORD +0 -21
- {logger_36-2024.1.dist-info → logger_36-2025.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,67 @@
|
|
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 logging as lggg
|
8
|
+
import re as regx
|
9
|
+
import typing as h
|
10
|
+
|
11
|
+
LOGGER_NAME = "logger-36"
|
12
|
+
|
13
|
+
# https://docs.python.org/3/library/logging.html#logging.captureWarnings
|
14
|
+
WARNING_LOGGER_NAME = "py.warnings"
|
15
|
+
WARNING_TYPE_PATTERN = r"\s*([^:]+):([0-9]+):\s*([^:]+)\s*:((.|\n)*)"
|
16
|
+
WARNING_TYPE_COMPILED_PATTERN = regx.compile(WARNING_TYPE_PATTERN)
|
17
|
+
|
18
|
+
# Second version: with self as first parameter.
|
19
|
+
logger_handle_h = (
|
20
|
+
h.Callable[[lggg.LogRecord], None] | h.Callable[[lggg.Logger, lggg.LogRecord], None]
|
21
|
+
)
|
22
|
+
|
23
|
+
"""
|
24
|
+
COPYRIGHT NOTICE
|
25
|
+
|
26
|
+
This software is governed by the CeCILL license under French law and
|
27
|
+
abiding by the rules of distribution of free software. You can use,
|
28
|
+
modify and/ or redistribute the software under the terms of the CeCILL
|
29
|
+
license as circulated by CEA, CNRS and INRIA at the following URL
|
30
|
+
"http://www.cecill.info".
|
31
|
+
|
32
|
+
As a counterpart to the access to the source code and rights to copy,
|
33
|
+
modify and redistribute granted by the license, users are provided only
|
34
|
+
with a limited warranty and the software's author, the holder of the
|
35
|
+
economic rights, and the successive licensors have only limited
|
36
|
+
liability.
|
37
|
+
|
38
|
+
In this respect, the user's attention is drawn to the risks associated
|
39
|
+
with loading, using, modifying and/or developing or reproducing the
|
40
|
+
software by the user in light of its specific status of free software,
|
41
|
+
that may mean that it is complicated to manipulate, and that also
|
42
|
+
therefore means that it is reserved for developers and experienced
|
43
|
+
professionals having in-depth computer knowledge. Users are therefore
|
44
|
+
encouraged to load and test the software's suitability as regards their
|
45
|
+
requirements in conditions enabling the security of their systems and/or
|
46
|
+
data to be ensured and, more generally, to use and operate it in the
|
47
|
+
same conditions as regards security.
|
48
|
+
|
49
|
+
The fact that you are presently reading this means that you have had
|
50
|
+
knowledge of the CeCILL license and that you accept its terms.
|
51
|
+
|
52
|
+
SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
|
53
|
+
|
54
|
+
This software is being developed by Eric Debreuve, a CNRS employee and
|
55
|
+
member of team Morpheme.
|
56
|
+
Team Morpheme is a joint team between Inria, CNRS, and UniCA.
|
57
|
+
It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
|
58
|
+
I3S, and Laboratory iBV.
|
59
|
+
|
60
|
+
CNRS: https://www.cnrs.fr/index.php/en
|
61
|
+
Inria: https://www.inria.fr/en/
|
62
|
+
UniCA: https://univ-cotedazur.eu/
|
63
|
+
Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
|
64
|
+
I3S: https://www.i3s.unice.fr/en/
|
65
|
+
iBV: http://ibv.unice.fr/
|
66
|
+
Team Morpheme: https://team.inria.fr/morpheme/
|
67
|
+
"""
|
@@ -0,0 +1,58 @@
|
|
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 typing as h
|
8
|
+
|
9
|
+
storage_units_h = h.Literal["b", "k", "m", "g", "a"]
|
10
|
+
STORAGE_UNITS: tuple[str, ...] = h.get_args(storage_units_h)
|
11
|
+
|
12
|
+
UNKNOWN_MEMORY_USAGE = -1
|
13
|
+
|
14
|
+
"""
|
15
|
+
COPYRIGHT NOTICE
|
16
|
+
|
17
|
+
This software is governed by the CeCILL license under French law and
|
18
|
+
abiding by the rules of distribution of free software. You can use,
|
19
|
+
modify and/ or redistribute the software under the terms of the CeCILL
|
20
|
+
license as circulated by CEA, CNRS and INRIA at the following URL
|
21
|
+
"http://www.cecill.info".
|
22
|
+
|
23
|
+
As a counterpart to the access to the source code and rights to copy,
|
24
|
+
modify and redistribute granted by the license, users are provided only
|
25
|
+
with a limited warranty and the software's author, the holder of the
|
26
|
+
economic rights, and the successive licensors have only limited
|
27
|
+
liability.
|
28
|
+
|
29
|
+
In this respect, the user's attention is drawn to the risks associated
|
30
|
+
with loading, using, modifying and/or developing or reproducing the
|
31
|
+
software by the user in light of its specific status of free software,
|
32
|
+
that may mean that it is complicated to manipulate, and that also
|
33
|
+
therefore means that it is reserved for developers and experienced
|
34
|
+
professionals having in-depth computer knowledge. Users are therefore
|
35
|
+
encouraged to load and test the software's suitability as regards their
|
36
|
+
requirements in conditions enabling the security of their systems and/or
|
37
|
+
data to be ensured and, more generally, to use and operate it in the
|
38
|
+
same conditions as regards security.
|
39
|
+
|
40
|
+
The fact that you are presently reading this means that you have had
|
41
|
+
knowledge of the CeCILL license and that you accept its terms.
|
42
|
+
|
43
|
+
SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
|
44
|
+
|
45
|
+
This software is being developed by Eric Debreuve, a CNRS employee and
|
46
|
+
member of team Morpheme.
|
47
|
+
Team Morpheme is a joint team between Inria, CNRS, and UniCA.
|
48
|
+
It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
|
49
|
+
I3S, and Laboratory iBV.
|
50
|
+
|
51
|
+
CNRS: https://www.cnrs.fr/index.php/en
|
52
|
+
Inria: https://www.inria.fr/en/
|
53
|
+
UniCA: https://univ-cotedazur.eu/
|
54
|
+
Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
|
55
|
+
I3S: https://www.i3s.unice.fr/en/
|
56
|
+
iBV: http://ibv.unice.fr/
|
57
|
+
Team Morpheme: https://team.inria.fr/morpheme/
|
58
|
+
"""
|
@@ -0,0 +1,72 @@
|
|
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 time
|
8
|
+
import typing as h
|
9
|
+
|
10
|
+
from logger_36.config.message import (
|
11
|
+
ELAPSED_TIME_SEPARATOR,
|
12
|
+
LEVEL_CLOSING,
|
13
|
+
LEVEL_OPENING,
|
14
|
+
MESSAGE_MARKER,
|
15
|
+
TIME_FORMAT,
|
16
|
+
)
|
17
|
+
|
18
|
+
TIME_LENGTH = time.strftime(TIME_FORMAT, time.gmtime(0)).__len__()
|
19
|
+
TIME_LENGTH_m_1 = TIME_LENGTH - ELAPSED_TIME_SEPARATOR.__len__()
|
20
|
+
LOG_LEVEL_LENGTH = 1 + LEVEL_OPENING.__len__() + LEVEL_CLOSING.__len__()
|
21
|
+
CONTEXT_LENGTH = TIME_LENGTH + LOG_LEVEL_LENGTH
|
22
|
+
LINE_INDENT = (CONTEXT_LENGTH + MESSAGE_MARKER.__len__() + 2) * " "
|
23
|
+
NEXT_LINE_PROLOGUE = "\n" + LINE_INDENT
|
24
|
+
|
25
|
+
expected_op_h = h.Literal[":", ": ", "=", "!=", ">=", "<="]
|
26
|
+
EXPECTED_OP: tuple[str, ...] = h.get_args(expected_op_h)
|
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
|
+
"""
|
@@ -0,0 +1,55 @@
|
|
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
|
+
SHOW_W_RULE_ATTR = "should_show_w_rule"
|
8
|
+
STORE_MEMORY_ATTR = "should_store_memory_usage"
|
9
|
+
HIDE_WHERE_ATTR = "should_hide_where"
|
10
|
+
|
11
|
+
"""
|
12
|
+
COPYRIGHT NOTICE
|
13
|
+
|
14
|
+
This software is governed by the CeCILL license under French law and
|
15
|
+
abiding by the rules of distribution of free software. You can use,
|
16
|
+
modify and/ or redistribute the software under the terms of the CeCILL
|
17
|
+
license as circulated by CEA, CNRS and INRIA at the following URL
|
18
|
+
"http://www.cecill.info".
|
19
|
+
|
20
|
+
As a counterpart to the access to the source code and rights to copy,
|
21
|
+
modify and redistribute granted by the license, users are provided only
|
22
|
+
with a limited warranty and the software's author, the holder of the
|
23
|
+
economic rights, and the successive licensors have only limited
|
24
|
+
liability.
|
25
|
+
|
26
|
+
In this respect, the user's attention is drawn to the risks associated
|
27
|
+
with loading, using, modifying and/or developing or reproducing the
|
28
|
+
software by the user in light of its specific status of free software,
|
29
|
+
that may mean that it is complicated to manipulate, and that also
|
30
|
+
therefore means that it is reserved for developers and experienced
|
31
|
+
professionals having in-depth computer knowledge. Users are therefore
|
32
|
+
encouraged to load and test the software's suitability as regards their
|
33
|
+
requirements in conditions enabling the security of their systems and/or
|
34
|
+
data to be ensured and, more generally, to use and operate it in the
|
35
|
+
same conditions as regards security.
|
36
|
+
|
37
|
+
The fact that you are presently reading this means that you have had
|
38
|
+
knowledge of the CeCILL license and that you accept its terms.
|
39
|
+
|
40
|
+
SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
|
41
|
+
|
42
|
+
This software is being developed by Eric Debreuve, a CNRS employee and
|
43
|
+
member of team Morpheme.
|
44
|
+
Team Morpheme is a joint team between Inria, CNRS, and UniCA.
|
45
|
+
It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
|
46
|
+
I3S, and Laboratory iBV.
|
47
|
+
|
48
|
+
CNRS: https://www.cnrs.fr/index.php/en
|
49
|
+
Inria: https://www.inria.fr/en/
|
50
|
+
UniCA: https://univ-cotedazur.eu/
|
51
|
+
Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
|
52
|
+
I3S: https://www.i3s.unice.fr/en/
|
53
|
+
iBV: http://ibv.unice.fr/
|
54
|
+
Team Morpheme: https://team.inria.fr/morpheme/
|
55
|
+
"""
|
@@ -0,0 +1,60 @@
|
|
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 platform as pltf
|
8
|
+
|
9
|
+
from logger_36.config.system import SYSTEM_DETAILS
|
10
|
+
|
11
|
+
SYSTEM_DETAILS_AS_DICT = {
|
12
|
+
_dtl.capitalize(): getattr(pltf, _dtl)() for _dtl in SYSTEM_DETAILS
|
13
|
+
}
|
14
|
+
MAX_DETAIL_NAME_LENGTH = max(map(len, SYSTEM_DETAILS_AS_DICT.keys()))
|
15
|
+
|
16
|
+
"""
|
17
|
+
COPYRIGHT NOTICE
|
18
|
+
|
19
|
+
This software is governed by the CeCILL license under French law and
|
20
|
+
abiding by the rules of distribution of free software. You can use,
|
21
|
+
modify and/ or redistribute the software under the terms of the CeCILL
|
22
|
+
license as circulated by CEA, CNRS and INRIA at the following URL
|
23
|
+
"http://www.cecill.info".
|
24
|
+
|
25
|
+
As a counterpart to the access to the source code and rights to copy,
|
26
|
+
modify and redistribute granted by the license, users are provided only
|
27
|
+
with a limited warranty and the software's author, the holder of the
|
28
|
+
economic rights, and the successive licensors have only limited
|
29
|
+
liability.
|
30
|
+
|
31
|
+
In this respect, the user's attention is drawn to the risks associated
|
32
|
+
with loading, using, modifying and/or developing or reproducing the
|
33
|
+
software by the user in light of its specific status of free software,
|
34
|
+
that may mean that it is complicated to manipulate, and that also
|
35
|
+
therefore means that it is reserved for developers and experienced
|
36
|
+
professionals having in-depth computer knowledge. Users are therefore
|
37
|
+
encouraged to load and test the software's suitability as regards their
|
38
|
+
requirements in conditions enabling the security of their systems and/or
|
39
|
+
data to be ensured and, more generally, to use and operate it in the
|
40
|
+
same conditions as regards security.
|
41
|
+
|
42
|
+
The fact that you are presently reading this means that you have had
|
43
|
+
knowledge of the CeCILL license and that you accept its terms.
|
44
|
+
|
45
|
+
SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
|
46
|
+
|
47
|
+
This software is being developed by Eric Debreuve, a CNRS employee and
|
48
|
+
member of team Morpheme.
|
49
|
+
Team Morpheme is a joint team between Inria, CNRS, and UniCA.
|
50
|
+
It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
|
51
|
+
I3S, and Laboratory iBV.
|
52
|
+
|
53
|
+
CNRS: https://www.cnrs.fr/index.php/en
|
54
|
+
Inria: https://www.inria.fr/en/
|
55
|
+
UniCA: https://univ-cotedazur.eu/
|
56
|
+
Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
|
57
|
+
I3S: https://www.i3s.unice.fr/en/
|
58
|
+
iBV: http://ibv.unice.fr/
|
59
|
+
Team Morpheme: https://team.inria.fr/morpheme/
|
60
|
+
"""
|
logger_36/content.py
ADDED
@@ -0,0 +1,55 @@
|
|
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.constant.message import LINE_INDENT
|
8
|
+
from logger_36.task.format.message import MessageWithActualExpected
|
9
|
+
from logger_36.task.format.rule import Rule, RuleAsText
|
10
|
+
|
11
|
+
"""
|
12
|
+
COPYRIGHT NOTICE
|
13
|
+
|
14
|
+
This software is governed by the CeCILL license under French law and
|
15
|
+
abiding by the rules of distribution of free software. You can use,
|
16
|
+
modify and/ or redistribute the software under the terms of the CeCILL
|
17
|
+
license as circulated by CEA, CNRS and INRIA at the following URL
|
18
|
+
"http://www.cecill.info".
|
19
|
+
|
20
|
+
As a counterpart to the access to the source code and rights to copy,
|
21
|
+
modify and redistribute granted by the license, users are provided only
|
22
|
+
with a limited warranty and the software's author, the holder of the
|
23
|
+
economic rights, and the successive licensors have only limited
|
24
|
+
liability.
|
25
|
+
|
26
|
+
In this respect, the user's attention is drawn to the risks associated
|
27
|
+
with loading, using, modifying and/or developing or reproducing the
|
28
|
+
software by the user in light of its specific status of free software,
|
29
|
+
that may mean that it is complicated to manipulate, and that also
|
30
|
+
therefore means that it is reserved for developers and experienced
|
31
|
+
professionals having in-depth computer knowledge. Users are therefore
|
32
|
+
encouraged to load and test the software's suitability as regards their
|
33
|
+
requirements in conditions enabling the security of their systems and/or
|
34
|
+
data to be ensured and, more generally, to use and operate it in the
|
35
|
+
same conditions as regards security.
|
36
|
+
|
37
|
+
The fact that you are presently reading this means that you have had
|
38
|
+
knowledge of the CeCILL license and that you accept its terms.
|
39
|
+
|
40
|
+
SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
|
41
|
+
|
42
|
+
This software is being developed by Eric Debreuve, a CNRS employee and
|
43
|
+
member of team Morpheme.
|
44
|
+
Team Morpheme is a joint team between Inria, CNRS, and UniCA.
|
45
|
+
It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
|
46
|
+
I3S, and Laboratory iBV.
|
47
|
+
|
48
|
+
CNRS: https://www.cnrs.fr/index.php/en
|
49
|
+
Inria: https://www.inria.fr/en/
|
50
|
+
UniCA: https://univ-cotedazur.eu/
|
51
|
+
Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
|
52
|
+
I3S: https://www.i3s.unice.fr/en/
|
53
|
+
iBV: http://ibv.unice.fr/
|
54
|
+
Team Morpheme: https://team.inria.fr/morpheme/
|
55
|
+
"""
|
logger_36/exception.py
ADDED
@@ -0,0 +1,105 @@
|
|
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
|
+
from pathlib import Path as path_t
|
12
|
+
|
13
|
+
_ORIGINAL_EXCEPTION_HANDLER = sstm.excepthook
|
14
|
+
|
15
|
+
|
16
|
+
def OverrideExceptionFormat() -> None:
|
17
|
+
""""""
|
18
|
+
sstm.excepthook = _HandleException
|
19
|
+
|
20
|
+
|
21
|
+
def ResetExceptionFormat() -> None:
|
22
|
+
""""""
|
23
|
+
sstm.excepthook = _ORIGINAL_EXCEPTION_HANDLER
|
24
|
+
|
25
|
+
|
26
|
+
def _HandleException(
|
27
|
+
stripe: type[Exception], exception: Exception, trace: t.TracebackType, /
|
28
|
+
) -> None:
|
29
|
+
""""""
|
30
|
+
while trace.tb_next is not None:
|
31
|
+
trace = trace.tb_next
|
32
|
+
frame = trace.tb_frame
|
33
|
+
module = frame.f_code.co_filename
|
34
|
+
function = frame.f_code.co_name
|
35
|
+
line = frame.f_lineno
|
36
|
+
|
37
|
+
home = str(path_t.home())
|
38
|
+
if module.startswith(home):
|
39
|
+
module = "~" + module[home.__len__():]
|
40
|
+
|
41
|
+
message = str(exception)
|
42
|
+
if message.__len__() > 0:
|
43
|
+
message = f" {message}\n"
|
44
|
+
|
45
|
+
document = tmpf.NamedTemporaryFile(delete=False)
|
46
|
+
|
47
|
+
print(
|
48
|
+
f"{stripe.__name__}\n"
|
49
|
+
f" {module}.{function}@{line}\n"
|
50
|
+
f"{message} Full report at: {document.name}",
|
51
|
+
file=sstm.stderr,
|
52
|
+
)
|
53
|
+
|
54
|
+
lines = tcbk.format_exception(exception)
|
55
|
+
message = "".join(lines)
|
56
|
+
|
57
|
+
document.write(message.encode())
|
58
|
+
document.close()
|
59
|
+
|
60
|
+
|
61
|
+
"""
|
62
|
+
COPYRIGHT NOTICE
|
63
|
+
|
64
|
+
This software is governed by the CeCILL license under French law and
|
65
|
+
abiding by the rules of distribution of free software. You can use,
|
66
|
+
modify and/ or redistribute the software under the terms of the CeCILL
|
67
|
+
license as circulated by CEA, CNRS and INRIA at the following URL
|
68
|
+
"http://www.cecill.info".
|
69
|
+
|
70
|
+
As a counterpart to the access to the source code and rights to copy,
|
71
|
+
modify and redistribute granted by the license, users are provided only
|
72
|
+
with a limited warranty and the software's author, the holder of the
|
73
|
+
economic rights, and the successive licensors have only limited
|
74
|
+
liability.
|
75
|
+
|
76
|
+
In this respect, the user's attention is drawn to the risks associated
|
77
|
+
with loading, using, modifying and/or developing or reproducing the
|
78
|
+
software by the user in light of its specific status of free software,
|
79
|
+
that may mean that it is complicated to manipulate, and that also
|
80
|
+
therefore means that it is reserved for developers and experienced
|
81
|
+
professionals having in-depth computer knowledge. Users are therefore
|
82
|
+
encouraged to load and test the software's suitability as regards their
|
83
|
+
requirements in conditions enabling the security of their systems and/or
|
84
|
+
data to be ensured and, more generally, to use and operate it in the
|
85
|
+
same conditions as regards security.
|
86
|
+
|
87
|
+
The fact that you are presently reading this means that you have had
|
88
|
+
knowledge of the CeCILL license and that you accept its terms.
|
89
|
+
|
90
|
+
SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
|
91
|
+
|
92
|
+
This software is being developed by Eric Debreuve, a CNRS employee and
|
93
|
+
member of team Morpheme.
|
94
|
+
Team Morpheme is a joint team between Inria, CNRS, and UniCA.
|
95
|
+
It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
|
96
|
+
I3S, and Laboratory iBV.
|
97
|
+
|
98
|
+
CNRS: https://www.cnrs.fr/index.php/en
|
99
|
+
Inria: https://www.inria.fr/en/
|
100
|
+
UniCA: https://univ-cotedazur.eu/
|
101
|
+
Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
|
102
|
+
I3S: https://www.i3s.unice.fr/en/
|
103
|
+
iBV: http://ibv.unice.fr/
|
104
|
+
Team Morpheme: https://team.inria.fr/morpheme/
|
105
|
+
"""
|
logger_36/gpu.py
ADDED
@@ -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.catalog.logger.gpu import LogGPURelatedDetails
|
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
|
+
"""
|