logger-36 2023.13__py3-none-any.whl → 2025.3__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 +65 -41
- 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 +164 -0
- 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-2023.13.dist-info → logger_36-2025.3.dist-info}/WHEEL +1 -1
- logger_36/config.py +0 -66
- logger_36/constant.py +0 -57
- logger_36/main.py +0 -185
- logger_36/measure/chronos.py +0 -55
- logger_36/measure/memory.py +0 -102
- 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 -116
- logger_36-2023.13.dist-info/METADATA +0 -106
- logger_36-2023.13.dist-info/RECORD +0 -16
- {logger_36-2023.13.dist-info → logger_36-2025.3.dist-info}/top_level.txt +0 -0
logger_36/version.py
CHANGED
@@ -1,32 +1,53 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
+
__version__ = "2025.3"
|
8
|
+
|
9
|
+
"""
|
10
|
+
COPYRIGHT NOTICE
|
11
|
+
|
12
|
+
This software is governed by the CeCILL license under French law and
|
13
|
+
abiding by the rules of distribution of free software. You can use,
|
14
|
+
modify and/ or redistribute the software under the terms of the CeCILL
|
15
|
+
license as circulated by CEA, CNRS and INRIA at the following URL
|
16
|
+
"http://www.cecill.info".
|
17
|
+
|
18
|
+
As a counterpart to the access to the source code and rights to copy,
|
19
|
+
modify and redistribute granted by the license, users are provided only
|
20
|
+
with a limited warranty and the software's author, the holder of the
|
21
|
+
economic rights, and the successive licensors have only limited
|
22
|
+
liability.
|
23
|
+
|
24
|
+
In this respect, the user's attention is drawn to the risks associated
|
25
|
+
with loading, using, modifying and/or developing or reproducing the
|
26
|
+
software by the user in light of its specific status of free software,
|
27
|
+
that may mean that it is complicated to manipulate, and that also
|
28
|
+
therefore means that it is reserved for developers and experienced
|
29
|
+
professionals having in-depth computer knowledge. Users are therefore
|
30
|
+
encouraged to load and test the software's suitability as regards their
|
31
|
+
requirements in conditions enabling the security of their systems and/or
|
32
|
+
data to be ensured and, more generally, to use and operate it in the
|
33
|
+
same conditions as regards security.
|
34
|
+
|
35
|
+
The fact that you are presently reading this means that you have had
|
36
|
+
knowledge of the CeCILL license and that you accept its terms.
|
37
|
+
|
38
|
+
SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
|
39
|
+
|
40
|
+
This software is being developed by Eric Debreuve, a CNRS employee and
|
41
|
+
member of team Morpheme.
|
42
|
+
Team Morpheme is a joint team between Inria, CNRS, and UniCA.
|
43
|
+
It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
|
44
|
+
I3S, and Laboratory iBV.
|
45
|
+
|
46
|
+
CNRS: https://www.cnrs.fr/index.php/en
|
47
|
+
Inria: https://www.inria.fr/en/
|
48
|
+
UniCA: https://univ-cotedazur.eu/
|
49
|
+
Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
|
50
|
+
I3S: https://www.i3s.unice.fr/en/
|
51
|
+
iBV: http://ibv.unice.fr/
|
52
|
+
Team Morpheme: https://team.inria.fr/morpheme/
|
53
|
+
"""
|
@@ -0,0 +1,154 @@
|
|
1
|
+
Metadata-Version: 2.2
|
2
|
+
Name: logger-36
|
3
|
+
Version: 2025.3
|
4
|
+
Summary: Simple logger with a catalog of handlers
|
5
|
+
Home-page: https://src.koda.cnrs.fr/eric.debreuve/logger-36/
|
6
|
+
Author: Eric Debreuve
|
7
|
+
Author-email: eric.debreuve@cnrs.fr
|
8
|
+
License: CeCILL-2.1
|
9
|
+
Project-URL: Documentation, https://src.koda.cnrs.fr/eric.debreuve/logger-36/-/wikis/home
|
10
|
+
Project-URL: Source, https://src.koda.cnrs.fr/eric.debreuve/logger-36/
|
11
|
+
Keywords: log,warning,error
|
12
|
+
Classifier: Topic :: Software Development
|
13
|
+
Classifier: Intended Audience :: Developers
|
14
|
+
Classifier: License :: OSI Approved :: CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
16
|
+
Classifier: Development Status :: 5 - Production/Stable
|
17
|
+
Requires-Python: >=3.11
|
18
|
+
Description-Content-Type: text/x-rst
|
19
|
+
Dynamic: author
|
20
|
+
Dynamic: author-email
|
21
|
+
Dynamic: classifier
|
22
|
+
Dynamic: description
|
23
|
+
Dynamic: description-content-type
|
24
|
+
Dynamic: home-page
|
25
|
+
Dynamic: keywords
|
26
|
+
Dynamic: license
|
27
|
+
Dynamic: project-url
|
28
|
+
Dynamic: requires-python
|
29
|
+
Dynamic: summary
|
30
|
+
|
31
|
+
..
|
32
|
+
Copyright CNRS/Inria/UniCA
|
33
|
+
Contributor(s): Eric Debreuve (eric.debreuve@cnrs.fr) since 2023
|
34
|
+
SEE COPYRIGHT NOTICE BELOW
|
35
|
+
|
36
|
+
.. |PROJECT_NAME| replace:: logger-36
|
37
|
+
.. |SHORT_DESCRIPTION| replace:: Simple logger with a catalog of handlers
|
38
|
+
|
39
|
+
.. |PYPI_NAME_LITERAL| replace:: ``logger-36``
|
40
|
+
.. |PYPI_PROJECT_URL| replace:: https://pypi.org/project/logger-36/
|
41
|
+
.. _PYPI_PROJECT_URL: https://pypi.org/project/logger-36/
|
42
|
+
|
43
|
+
.. |DOCUMENTATION_URL| replace:: https://src.koda.cnrs.fr/eric.debreuve/logger-36/-/wikis/home
|
44
|
+
.. _DOCUMENTATION_URL: https://src.koda.cnrs.fr/eric.debreuve/logger-36/-/wikis/home
|
45
|
+
|
46
|
+
.. |DEPENDENCIES_MANDATORY| replace:: None
|
47
|
+
.. |DEPENDENCIES_OPTIONAL| replace:: psutil, rich, tensorflow, tensorrt
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
===================================
|
52
|
+
|PROJECT_NAME|: |SHORT_DESCRIPTION|
|
53
|
+
===================================
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
Documentation
|
58
|
+
=============
|
59
|
+
|
60
|
+
The documentation is available at |DOCUMENTATION_URL|_.
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
Installation
|
65
|
+
============
|
66
|
+
|
67
|
+
This project is published
|
68
|
+
on the `Python Package Index (PyPI) <https://pypi.org/>`_
|
69
|
+
at: |PYPI_PROJECT_URL|_.
|
70
|
+
It should be installable from Python distribution platforms or Integrated Development Environments (IDEs).
|
71
|
+
Otherwise, it can be installed from a command console using `pip <https://pip.pypa.io/>`_:
|
72
|
+
|
73
|
+
+--------------+-------------------------------------------------------+----------------------------------------------------------+
|
74
|
+
| | For all users (after acquiring administrative rights) | For the current user (no administrative rights required) |
|
75
|
+
+==============+=======================================================+==========================================================+
|
76
|
+
| Installation | ``pip install`` |PYPI_NAME_LITERAL| | ``pip install --user`` |PYPI_NAME_LITERAL| |
|
77
|
+
+--------------+-------------------------------------------------------+----------------------------------------------------------+
|
78
|
+
| Update | ``pip install --upgrade`` |PYPI_NAME_LITERAL| | ``pip install --user --upgrade`` |PYPI_NAME_LITERAL| |
|
79
|
+
+--------------+-------------------------------------------------------+----------------------------------------------------------+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
Dependencies
|
84
|
+
============
|
85
|
+
|
86
|
+
The development relies on several packages:
|
87
|
+
|
88
|
+
- Mandatory: |DEPENDENCIES_MANDATORY|
|
89
|
+
- Optional: |DEPENDENCIES_OPTIONAL|
|
90
|
+
|
91
|
+
The mandatory dependencies, if any, are installed automatically by `pip <https://pip.pypa.io/>`_, if they are not already, as part of the installation of |PROJECT_NAME|.
|
92
|
+
Python distribution platforms or Integrated Development Environments (IDEs) should also take care of this.
|
93
|
+
The optional dependencies, if any, must be installed independently by following the related instructions, for added functionalities of |PROJECT_NAME|.
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
Acknowledgments
|
98
|
+
===============
|
99
|
+
|
100
|
+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
101
|
+
:target: https://github.com/psf/black
|
102
|
+
.. image:: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336
|
103
|
+
:target: https://pycqa.github.io/isort/
|
104
|
+
|
105
|
+
The project is developed with `PyCharm Community <https://www.jetbrains.com/pycharm/>`_.
|
106
|
+
|
107
|
+
The code is formatted by `Black <https://github.com/psf/black/>`_, *The Uncompromising Code Formatter*.
|
108
|
+
|
109
|
+
The imports are ordered by `isort <https://github.com/timothycrosley/isort/>`_... *your imports, so you don't have to*.
|
110
|
+
|
111
|
+
..
|
112
|
+
COPYRIGHT NOTICE
|
113
|
+
|
114
|
+
This software is governed by the CeCILL license under French law and
|
115
|
+
abiding by the rules of distribution of free software. You can use,
|
116
|
+
modify and/ or redistribute the software under the terms of the CeCILL
|
117
|
+
license as circulated by CEA, CNRS and INRIA at the following URL
|
118
|
+
"http://www.cecill.info".
|
119
|
+
|
120
|
+
As a counterpart to the access to the source code and rights to copy,
|
121
|
+
modify and redistribute granted by the license, users are provided only
|
122
|
+
with a limited warranty and the software's author, the holder of the
|
123
|
+
economic rights, and the successive licensors have only limited
|
124
|
+
liability.
|
125
|
+
|
126
|
+
In this respect, the user's attention is drawn to the risks associated
|
127
|
+
with loading, using, modifying and/or developing or reproducing the
|
128
|
+
software by the user in light of its specific status of free software,
|
129
|
+
that may mean that it is complicated to manipulate, and that also
|
130
|
+
therefore means that it is reserved for developers and experienced
|
131
|
+
professionals having in-depth computer knowledge. Users are therefore
|
132
|
+
encouraged to load and test the software's suitability as regards their
|
133
|
+
requirements in conditions enabling the security of their systems and/or
|
134
|
+
data to be ensured and, more generally, to use and operate it in the
|
135
|
+
same conditions as regards security.
|
136
|
+
|
137
|
+
The fact that you are presently reading this means that you have had
|
138
|
+
knowledge of the CeCILL license and that you accept its terms.
|
139
|
+
|
140
|
+
SEE LICENCE NOTICE: file README-LICENCE-utf8.txt at project source root.
|
141
|
+
|
142
|
+
This software is being developed by Eric Debreuve, a CNRS employee and
|
143
|
+
member of team Morpheme.
|
144
|
+
Team Morpheme is a joint team between Inria, CNRS, and UniCA.
|
145
|
+
It is hosted by the Centre Inria d'Université Côte d'Azur, Laboratory
|
146
|
+
I3S, and Laboratory iBV.
|
147
|
+
|
148
|
+
CNRS: https://www.cnrs.fr/index.php/en
|
149
|
+
Inria: https://www.inria.fr/en/
|
150
|
+
UniCA: https://univ-cotedazur.eu/
|
151
|
+
Centre Inria d'Université Côte d'Azur: https://www.inria.fr/en/centre/sophia/
|
152
|
+
I3S: https://www.i3s.unice.fr/en/
|
153
|
+
iBV: http://ibv.unice.fr/
|
154
|
+
Team Morpheme: https://team.inria.fr/morpheme/
|
@@ -0,0 +1,52 @@
|
|
1
|
+
logger_36/__init__.py,sha256=R2KOBgWqAFZz7wZXXlRu32B0e1-jJtbnJvzKueCoPjw,2596
|
2
|
+
logger_36/content.py,sha256=ni9gdYYNZoDa91KNianWBluOBe9KxZMZtzalcBS6vhE,2357
|
3
|
+
logger_36/exception.py,sha256=URyi0OX9fh7QAyJ6eVbHW8mO_RDrBoWIcqvB_h2FBNo,3429
|
4
|
+
logger_36/gpu.py,sha256=YYFk6aYQrBDJfxQaDm-ar16T6SlOSL6jJWTOgvpF4EU,2244
|
5
|
+
logger_36/handler.py,sha256=vg8LOD0YzGQxyoKB7qr7c4rueRwp-sDF1svDHwffumg,6565
|
6
|
+
logger_36/memory.py,sha256=FTc3qCeMqnCNvHJ4Yds73noPENQx_U1MYB-R4LLUjVQ,2682
|
7
|
+
logger_36/storage.py,sha256=TNfIXEfHcjixv75wocUyqwX62iDYsor4srRqC3FNzbc,2231
|
8
|
+
logger_36/system.py,sha256=xzm6cMeTaCX9VX9ZRXUXgfqoT9oUtv3W2o_H2W0P-4Q,2243
|
9
|
+
logger_36/time.py,sha256=_CtpQeUZdsUNGNfwzhoWUiUvawRgmonqwZPHouzWf5M,2308
|
10
|
+
logger_36/version.py,sha256=IpCnkevO_x4CuJdzmP3OHWR5xfJ-mvQxsBLGIy3G__o,2205
|
11
|
+
logger_36/api/logger.py,sha256=Wg2nzQeuRVZ4v-oy3Q2KdYsHSzF9v7a0Fk6BzLnbkYw,2225
|
12
|
+
logger_36/api/storage.py,sha256=evKVqIsslA5X82LaZ2HQDxp7ltyNOn8Tr-3-Pic3eUo,2231
|
13
|
+
logger_36/catalog/config/console_rich.py,sha256=iyPFozVpw18qkRTBovhb2X2WM93MW5QqgwGQDSzUijI,2866
|
14
|
+
logger_36/catalog/handler/console.py,sha256=KL8oGdtQUUE8I5Pc_5wmD1MdDSw8E7dpybkzmFWKRUY,4247
|
15
|
+
logger_36/catalog/handler/console_rich.py,sha256=J1qb9Dd_GVKxGoDUw8ibg54YjR0pgaDo6evR9IUzYT8,8376
|
16
|
+
logger_36/catalog/handler/file.py,sha256=Ryb8ZMutOYgLmcNszK25yc9MqRn2qu6ACzvjNoeVxiA,4711
|
17
|
+
logger_36/catalog/handler/generic.py,sha256=ZIUI21H_7nkbWPMa8s0Xsijqsnlca3k0fS_KafnKG88,9102
|
18
|
+
logger_36/catalog/logger/chronos.py,sha256=7_Y_HxRHwwHyjOb2v4Y3CxMGCaJBWm7q8wlw05jZGvs,2447
|
19
|
+
logger_36/catalog/logger/gpu.py,sha256=KYCQN2wD9sxzUrcVS9633h0BmvaFMW-aniA6QK50H2g,3423
|
20
|
+
logger_36/catalog/logger/memory.py,sha256=xVPzFPL0v0X2yyjqxA3YIb8CGB2VMP0qz9c_PILatlE,4700
|
21
|
+
logger_36/catalog/logger/system.py,sha256=WRDlh0tr8NYp6AeVjLkmzuBMwtJxSokl4_mMJRH9OBU,3076
|
22
|
+
logger_36/config/issue.py,sha256=G-i5p6lhZCLAOa-VTMyL9ZonvGCvhdoQ5KZdSWgP-FU,2267
|
23
|
+
logger_36/config/logger.py,sha256=9vQ8m1sJsK8tjnh5SZEKzofqeVJbsULTm-ev2rk0x7M,3760
|
24
|
+
logger_36/config/memory.py,sha256=yCX5phsB_KJMr5xHpVUeOHFhAA7p_8yahP3X28VndOY,2217
|
25
|
+
logger_36/config/message.py,sha256=yfbMO_Jk1IbWvT6Lp6hVpID2Tr99cuiJ-ZaMBesIFXw,2527
|
26
|
+
logger_36/config/system.py,sha256=HD8ZuwsXhEAExeZrww8YoDkQGMs4T5RDqQMb1W4qVgc,2477
|
27
|
+
logger_36/constant/error.py,sha256=1gdnCwUu3d3ThL4AKxzjn7ijSTBWlr2g-8cAKbubl4A,2825
|
28
|
+
logger_36/constant/generic.py,sha256=t6aRb66_NHwMhR1p7BZ4QXTU2jpLz-H5YAL4PuMtKx8,2244
|
29
|
+
logger_36/constant/handler.py,sha256=cBf_bPB9fceCuIpzmqj345vaas-kx17YRO-rFF3Cvms,2338
|
30
|
+
logger_36/constant/issue.py,sha256=01l8itRPWGS5F6gXtsXUJgGR-4lS1Eu3_YeKC-khKLw,2315
|
31
|
+
logger_36/constant/logger.py,sha256=biZ-sE3PzwD2oV1qJ2epNN79BETMq7XOvgRAccqHhVQ,2676
|
32
|
+
logger_36/constant/memory.py,sha256=ZL1MwbdtNsrCrOwzEyfTsfOoOsRBTJtbbf3otHGnxXo,2343
|
33
|
+
logger_36/constant/message.py,sha256=Ys_CAyhENlT8Z3rr-AxO4hjdl1jLsKzVSPQ8wqLOCPQ,2838
|
34
|
+
logger_36/constant/record.py,sha256=9Q28lVH_s0og4v74delgwIPAJ9G28I5rBM-brXcoY80,2308
|
35
|
+
logger_36/constant/system.py,sha256=G2mzBTxRXoJMxb53TnmBaceMJC_q3WonoCG7y6nC_R8,2430
|
36
|
+
logger_36/instance/logger.py,sha256=ttKjl9MD7FUjqCWjv5w2hmmpDYxgaORcYf9NaaE9W_M,2246
|
37
|
+
logger_36/instance/loggers.py,sha256=RCWpC1NPAf6vXnFc9NqsSALv-x-FEzcH6k_OlxTxeQk,2251
|
38
|
+
logger_36/task/inspection.py,sha256=f9VkVrwMJ_ixV9rFu3XUNpmCbEgoo1tssqd2nMeGYLI,5028
|
39
|
+
logger_36/task/storage.py,sha256=rMqcVieK9KUEqE3fZWu2M1K99KCVzjsB4baUph5ITbs,5700
|
40
|
+
logger_36/task/format/memory.py,sha256=jpQS8tAdxy7GM_FzqEIJUU3m-6O9iX-jiyO7gx5YwR8,4266
|
41
|
+
logger_36/task/format/message.py,sha256=T2V2gUlUQqSojyRrz4I4uAHwNe6eBEsuAe6V-LTyx0k,3867
|
42
|
+
logger_36/task/format/rule.py,sha256=OjNZQa_dZrH4Vhide6xm3EuV0lLC6tR1Q2_ZAxD7ito,2813
|
43
|
+
logger_36/task/measure/chronos.py,sha256=bgF_VQ65bpwloZ_uqN8N-hQPnUGgWV-u_vdodbwi59g,3061
|
44
|
+
logger_36/task/measure/memory.py,sha256=-V9UDFlDwmtUlfBzovcMgmsaYxwyoE1YmfXjXZ2iuNc,2512
|
45
|
+
logger_36/type/handler.py,sha256=HJ547swaN1bdxnxoU4cIinWUkww3YAQ1vYgtugWk5X4,6474
|
46
|
+
logger_36/type/issue.py,sha256=p2upR8vAXPkrnSwPuM3R1hmTkRwJwL1e658L6WwSWfQ,3220
|
47
|
+
logger_36/type/logger.py,sha256=tnA8T4W54HL9iV_0NiS_bLpq8fDj5bGYhl_ge96unVI,19136
|
48
|
+
logger_36/type/loggers.py,sha256=znqxWBnfQxvkg3VUfbTUvt3S6Kq0DAzWWepxQDt9suI,2871
|
49
|
+
logger_36-2025.3.dist-info/METADATA,sha256=8M2HNFvBoElhgG9T4ilpsIat0fLvxxrMDQwFVphuj0k,6505
|
50
|
+
logger_36-2025.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
51
|
+
logger_36-2025.3.dist-info/top_level.txt,sha256=sM95BTMWmslEEgR_1pzwZsOeSp8C_QBiu8ImbFr0XLc,10
|
52
|
+
logger_36-2025.3.dist-info/RECORD,,
|
logger_36/config.py
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
# Copyright CNRS/Inria/UCA
|
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
|
-
LOGGER_NAME = "logger-36"
|
33
|
-
|
34
|
-
LEVEL_OPENING = "["
|
35
|
-
LEVEL_CLOSING = "]"
|
36
|
-
CONTEXT_SEPARATOR = "- "
|
37
|
-
WHERE_SEPARATOR = "@"
|
38
|
-
ELAPSED_TIME_SEPARATOR = "+"
|
39
|
-
MESSAGE_FORMAT = (
|
40
|
-
f"%(asctime)s{LEVEL_OPENING}%(levelname)s{LEVEL_CLOSING}\t"
|
41
|
-
f"{CONTEXT_SEPARATOR}"
|
42
|
-
f"%(message)s "
|
43
|
-
f"{WHERE_SEPARATOR} %(module)s:%(funcName)s:%(lineno)d "
|
44
|
-
f"{ELAPSED_TIME_SEPARATOR}%(elapsed_time)s"
|
45
|
-
f"%(memory_usage)s"
|
46
|
-
)
|
47
|
-
DATE_TIME_FORMAT = "%Y-%m-%d@%H:%M:%S"
|
48
|
-
|
49
|
-
SYSTEM_DETAILS = (
|
50
|
-
"node",
|
51
|
-
"machine",
|
52
|
-
"processor",
|
53
|
-
"architecture",
|
54
|
-
#
|
55
|
-
"system",
|
56
|
-
"release",
|
57
|
-
"version",
|
58
|
-
"platform",
|
59
|
-
#
|
60
|
-
"python_implementation",
|
61
|
-
"python_version",
|
62
|
-
"python_revision",
|
63
|
-
"python_branch",
|
64
|
-
"python_compiler",
|
65
|
-
"python_build",
|
66
|
-
)
|
logger_36/constant.py
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# Copyright CNRS/Inria/UCA
|
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 platform as pltf
|
33
|
-
from datetime import datetime as dttm
|
34
|
-
|
35
|
-
from logger_36.config import (
|
36
|
-
CONTEXT_SEPARATOR,
|
37
|
-
DATE_TIME_FORMAT,
|
38
|
-
LEVEL_CLOSING,
|
39
|
-
LEVEL_OPENING,
|
40
|
-
SYSTEM_DETAILS,
|
41
|
-
)
|
42
|
-
|
43
|
-
# This module is certainly imported early. Therefore, the current time should be close
|
44
|
-
# enough to the real start time.
|
45
|
-
START_TIME = dttm.now()
|
46
|
-
|
47
|
-
DATE_TIME_LENGTH = START_TIME.strftime(DATE_TIME_FORMAT).__len__()
|
48
|
-
LOG_LEVEL_LENGTH = (
|
49
|
-
max(map(len, ("DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL")))
|
50
|
-
+ LEVEL_OPENING.__len__()
|
51
|
-
+ LEVEL_CLOSING.__len__()
|
52
|
-
)
|
53
|
-
CONTEXT_LENGTH = DATE_TIME_LENGTH + LOG_LEVEL_LENGTH
|
54
|
-
NEXT_LINE_PROLOGUE = "\n" + (CONTEXT_LENGTH + CONTEXT_SEPARATOR.__len__() + 1) * " "
|
55
|
-
|
56
|
-
SYSTEM_DETAILS = {_dtl.capitalize(): getattr(pltf, _dtl)() for _dtl in SYSTEM_DETAILS}
|
57
|
-
MAX_DETAIL_NAME_LENGTH = max(map(len, SYSTEM_DETAILS.keys()))
|
logger_36/main.py
DELETED
@@ -1,185 +0,0 @@
|
|
1
|
-
# Copyright CNRS/Inria/UCA
|
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
|
-
"""
|
33
|
-
Alternative implementations: using logging.Filter or logging.LoggerAdapter.
|
34
|
-
"""
|
35
|
-
import logging as lggg
|
36
|
-
from pathlib import Path as path_t
|
37
|
-
from typing import Callable, Literal, TextIO
|
38
|
-
|
39
|
-
from rich.console import Console as console_t
|
40
|
-
|
41
|
-
from logger_36.config import LOGGER_NAME
|
42
|
-
from logger_36.constant import MAX_DETAIL_NAME_LENGTH, SYSTEM_DETAILS
|
43
|
-
from logger_36.measure.memory import CanCheckMemory
|
44
|
-
from logger_36.measure.memory import FormattedUsage as FormattedMemoryUsage
|
45
|
-
from logger_36.task.inspection import Modules
|
46
|
-
from logger_36.type.console import console_handler_t
|
47
|
-
from logger_36.type.file import file_handler_t
|
48
|
-
from logger_36.type.generic import can_show_message_p, generic_handler_t
|
49
|
-
|
50
|
-
LOGGER = lggg.getLogger(name=LOGGER_NAME)
|
51
|
-
LOGGER.setLevel(lggg.DEBUG)
|
52
|
-
LOGGER.addHandler(console_handler_t(level=lggg.INFO))
|
53
|
-
|
54
|
-
|
55
|
-
def AddFileHandler(
|
56
|
-
path: str | path_t, /, *args, level: int = lggg.INFO, **kwargs
|
57
|
-
) -> None:
|
58
|
-
""""""
|
59
|
-
if isinstance(path, str):
|
60
|
-
path = path_t(path)
|
61
|
-
if path.exists():
|
62
|
-
raise ValueError(f"{path}: File already exists")
|
63
|
-
|
64
|
-
handler = file_handler_t(path, *args, **kwargs)
|
65
|
-
handler.setLevel(level)
|
66
|
-
LOGGER.addHandler(handler)
|
67
|
-
|
68
|
-
|
69
|
-
def AddGenericHandler(
|
70
|
-
interface: can_show_message_p | Callable[[str], None],
|
71
|
-
/,
|
72
|
-
*args,
|
73
|
-
level: int = lggg.INFO,
|
74
|
-
supports_html: bool = False,
|
75
|
-
**kwargs,
|
76
|
-
) -> None:
|
77
|
-
""""""
|
78
|
-
handler = generic_handler_t(interface, *args, supports_html=supports_html, **kwargs)
|
79
|
-
handler.setLevel(level)
|
80
|
-
LOGGER.addHandler(handler)
|
81
|
-
|
82
|
-
|
83
|
-
def SetLOGLevel(level: int, /, *, which: Literal["c", "f", "a"] = "a") -> None:
|
84
|
-
"""
|
85
|
-
which: c=console, f=file, a=all
|
86
|
-
"""
|
87
|
-
if which not in "cfa":
|
88
|
-
raise ValueError(
|
89
|
-
f"{which}: Invalid handler specifier. "
|
90
|
-
f'Expected="c" for console, "f" for file, or "a" for all'
|
91
|
-
)
|
92
|
-
|
93
|
-
for handler in LOGGER.handlers:
|
94
|
-
if (
|
95
|
-
(which == "a")
|
96
|
-
or ((which == "c") and isinstance(handler, console_handler_t))
|
97
|
-
or ((which == "f") and isinstance(handler, file_handler_t))
|
98
|
-
):
|
99
|
-
handler.setLevel(level)
|
100
|
-
|
101
|
-
|
102
|
-
def SetExitOnError(exit_on_error: bool, /) -> None:
|
103
|
-
""""""
|
104
|
-
for handler in LOGGER.handlers:
|
105
|
-
if hasattr(handler, "exit_on_error"):
|
106
|
-
handler.exit_on_error = exit_on_error
|
107
|
-
|
108
|
-
|
109
|
-
def SetShowMemoryUsage(show_memory_usage: bool, /) -> None:
|
110
|
-
""""""
|
111
|
-
if show_memory_usage and not CanCheckMemory():
|
112
|
-
LOGGER.warning('Cannot show memory usage: Package "psutil" not installed')
|
113
|
-
return
|
114
|
-
|
115
|
-
for handler in LOGGER.handlers:
|
116
|
-
if hasattr(handler, "show_memory_usage"):
|
117
|
-
handler.show_memory_usage = show_memory_usage
|
118
|
-
|
119
|
-
|
120
|
-
def MaximumUsage(
|
121
|
-
*, unit: Literal["b", "k", "m", "g", "a"] | None = "a", decimals: int = None
|
122
|
-
) -> tuple[int | float, str]:
|
123
|
-
"""
|
124
|
-
unit: b or None=bytes, k=kilo, m=mega, g=giga, a=auto
|
125
|
-
"""
|
126
|
-
usage = max(getattr(_hdr, "max_memory_usage", -1) for _hdr in LOGGER.handlers)
|
127
|
-
return FormattedMemoryUsage(usage, unit=unit, decimals=decimals)
|
128
|
-
|
129
|
-
|
130
|
-
def LogSystemDetails() -> None:
|
131
|
-
""""""
|
132
|
-
details = "\n".join(
|
133
|
-
f" {_key:>{MAX_DETAIL_NAME_LENGTH}}: {_vle}"
|
134
|
-
for _key, _vle in SYSTEM_DETAILS.items()
|
135
|
-
)
|
136
|
-
|
137
|
-
LOGGER.info(
|
138
|
-
f"SYSTEM DETAILS\n"
|
139
|
-
f"{details}\n"
|
140
|
-
f" {'Python Modules':>{MAX_DETAIL_NAME_LENGTH}}:\n"
|
141
|
-
f" {Modules(True, True)}"
|
142
|
-
)
|
143
|
-
|
144
|
-
|
145
|
-
def SaveLOGasHTML(path: str | path_t | TextIO = None) -> None:
|
146
|
-
""""""
|
147
|
-
cannot_save = "Cannot save logging record as HTML"
|
148
|
-
|
149
|
-
if path is None:
|
150
|
-
for handler in LOGGER.handlers:
|
151
|
-
if isinstance(handler, lggg.FileHandler):
|
152
|
-
path = path_t(handler.baseFilename).with_suffix(".htm")
|
153
|
-
break
|
154
|
-
if path is None:
|
155
|
-
LOGGER.warning(f"{cannot_save}: No file handler to build a filename from.")
|
156
|
-
return
|
157
|
-
if path.exists():
|
158
|
-
LOGGER.warning(
|
159
|
-
f'{cannot_save}: Automatically generated path "{path}" already exists.'
|
160
|
-
)
|
161
|
-
return
|
162
|
-
elif isinstance(path, str):
|
163
|
-
path = path_t(path)
|
164
|
-
|
165
|
-
actual_file = isinstance(path, path_t)
|
166
|
-
if actual_file and path.exists():
|
167
|
-
LOGGER.warning(f'{cannot_save}: File "{path}" already exists.')
|
168
|
-
return
|
169
|
-
|
170
|
-
console = None
|
171
|
-
found = False
|
172
|
-
for handler in LOGGER.handlers:
|
173
|
-
console = getattr(handler, "console", None)
|
174
|
-
if found := isinstance(console, console_t):
|
175
|
-
break
|
176
|
-
|
177
|
-
if found:
|
178
|
-
html = console.export_html()
|
179
|
-
if actual_file:
|
180
|
-
with open(path, "w") as accessor:
|
181
|
-
accessor.write(html)
|
182
|
-
else:
|
183
|
-
path.write(html)
|
184
|
-
else:
|
185
|
-
LOGGER.warning(f"{cannot_save}: No handler has a RICH console.")
|
logger_36/measure/chronos.py
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
# Copyright CNRS/Inria/UCA
|
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 time
|
33
|
-
from datetime import datetime as dttm
|
34
|
-
|
35
|
-
from logger_36.constant import START_TIME
|
36
|
-
|
37
|
-
|
38
|
-
def TimeStamp() -> str:
|
39
|
-
""""""
|
40
|
-
return (
|
41
|
-
dttm.now()
|
42
|
-
.isoformat(timespec="milliseconds")
|
43
|
-
.replace(".", "-")
|
44
|
-
.replace(":", "-")
|
45
|
-
)
|
46
|
-
|
47
|
-
|
48
|
-
def ElapsedTime() -> str:
|
49
|
-
""""""
|
50
|
-
elapsed_seconds = (dttm.now() - START_TIME).total_seconds()
|
51
|
-
output = time.strftime("%Hh %Mm %Ss", time.gmtime(elapsed_seconds))
|
52
|
-
while output.startswith("00") and (" " in output):
|
53
|
-
output = output.split(maxsplit=1)[-1]
|
54
|
-
|
55
|
-
return output
|