logger-36 2024.1__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.
Files changed (67) hide show
  1. logger_36/__init__.py +64 -42
  2. logger_36/api/logger.py +53 -0
  3. logger_36/api/storage.py +53 -0
  4. logger_36/catalog/config/console_rich.py +76 -0
  5. logger_36/catalog/handler/console.py +117 -0
  6. logger_36/catalog/handler/console_rich.py +235 -0
  7. logger_36/catalog/handler/file.py +128 -0
  8. logger_36/catalog/handler/generic.py +228 -0
  9. logger_36/catalog/logger/chronos.py +61 -0
  10. logger_36/catalog/logger/gpu.py +90 -0
  11. logger_36/catalog/logger/memory.py +129 -0
  12. logger_36/catalog/logger/system.py +84 -0
  13. logger_36/config/issue.py +56 -0
  14. logger_36/config/logger.py +103 -0
  15. logger_36/config/memory.py +54 -0
  16. logger_36/config/message.py +66 -0
  17. logger_36/config/system.py +70 -0
  18. logger_36/constant/error.py +70 -0
  19. logger_36/constant/generic.py +58 -0
  20. logger_36/constant/handler.py +58 -0
  21. logger_36/constant/issue.py +58 -0
  22. logger_36/constant/logger.py +67 -0
  23. logger_36/constant/memory.py +58 -0
  24. logger_36/constant/message.py +72 -0
  25. logger_36/constant/record.py +55 -0
  26. logger_36/constant/system.py +60 -0
  27. logger_36/content.py +55 -0
  28. logger_36/exception.py +105 -0
  29. logger_36/gpu.py +53 -0
  30. logger_36/handler.py +209 -0
  31. logger_36/instance/logger.py +55 -0
  32. logger_36/instance/loggers.py +56 -0
  33. logger_36/memory.py +60 -0
  34. logger_36/storage.py +53 -0
  35. logger_36/system.py +53 -0
  36. logger_36/task/format/memory.py +132 -0
  37. logger_36/task/format/message.py +111 -0
  38. logger_36/task/format/rule.py +74 -0
  39. logger_36/task/inspection.py +70 -48
  40. logger_36/task/measure/chronos.py +84 -0
  41. logger_36/task/measure/memory.py +72 -0
  42. logger_36/task/storage.py +127 -46
  43. logger_36/time.py +54 -0
  44. logger_36/type/handler.py +184 -0
  45. logger_36/type/issue.py +91 -0
  46. logger_36/type/logger.py +542 -0
  47. logger_36/type/loggers.py +78 -0
  48. logger_36/version.py +53 -32
  49. logger_36-2025.3.dist-info/METADATA +154 -0
  50. logger_36-2025.3.dist-info/RECORD +52 -0
  51. {logger_36-2024.1.dist-info → logger_36-2025.3.dist-info}/WHEEL +1 -1
  52. logger_36/catalog/gpu.py +0 -56
  53. logger_36/catalog/memory.py +0 -109
  54. logger_36/catalog/system.py +0 -84
  55. logger_36/config.py +0 -48
  56. logger_36/constant.py +0 -52
  57. logger_36/instance.py +0 -34
  58. logger_36/main.py +0 -96
  59. logger_36/measure/chronos.py +0 -55
  60. logger_36/measure/memory.py +0 -50
  61. logger_36/type/console.py +0 -122
  62. logger_36/type/extension.py +0 -122
  63. logger_36/type/file.py +0 -52
  64. logger_36/type/generic.py +0 -115
  65. logger_36-2024.1.dist-info/METADATA +0 -106
  66. logger_36-2024.1.dist-info/RECORD +0 -21
  67. {logger_36-2024.1.dist-info → logger_36-2025.3.dist-info}/top_level.txt +0 -0
logger_36/version.py CHANGED
@@ -1,32 +1,53 @@
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
- __version__ = "2024.1"
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
logger_36/catalog/gpu.py DELETED
@@ -1,56 +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
- from logger_36.instance import LOGGER
33
-
34
- try:
35
- import tensorflow as tsfl
36
- import tensorrt as tsrt
37
- except ModuleNotFoundError:
38
- tsfl = tsrt = None
39
-
40
-
41
- def LogGPURelatedDetails() -> None:
42
- """"""
43
- if None in (tsfl, tsrt):
44
- return
45
-
46
- system_details = tsfl.sysconfig.get_build_info()
47
- LOGGER.info(
48
- f"GPU-RELATED DETAILS\n"
49
- f" GPUs: {tsfl.config.list_physical_devices('GPU')}\n"
50
- f" CPUs: {tsfl.config.list_physical_devices('CPU')}\n"
51
- f" Cuda: {system_details['cuda_version']}\n"
52
- f" CuDNN: {system_details['cudnn_version']}\n"
53
- f" Tensorflow: {tsfl.version.VERSION}\n"
54
- f" Tensorflow Build: {tsfl.sysconfig.get_build_info()}\n"
55
- f" TensorRT: {tsrt.__version__}"
56
- )
@@ -1,109 +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
- from typing import Literal
33
-
34
- from logger_36.instance import LOGGER
35
- from logger_36.measure.memory import CanCheckMemory
36
-
37
- _KILO_UNIT = 1024.0
38
- _MEGA_UNIT = _KILO_UNIT * 1024.0
39
- _GIGA_UNIT = _MEGA_UNIT * 1024.0
40
-
41
-
42
- def SetShowMemoryUsage(show_memory_usage: bool, /) -> None:
43
- """"""
44
- if show_memory_usage and not CanCheckMemory():
45
- LOGGER.warning('Cannot show memory usage: Package "psutil" not installed')
46
- return
47
-
48
- for handler in LOGGER.handlers:
49
- if hasattr(handler, "show_memory_usage"):
50
- handler.show_memory_usage = show_memory_usage
51
-
52
-
53
- def FormattedUsage(
54
- usage: int,
55
- /,
56
- *,
57
- unit: Literal["b", "k", "m", "g", "a"] | None = "a",
58
- decimals: int = None,
59
- ) -> tuple[int | float, str]:
60
- """
61
- unit: b or None=bytes, k=kilo, m=mega, g=giga, a=auto
62
- """
63
- if (unit is None) or (unit == "b"):
64
- unit = "B"
65
- elif unit == "k":
66
- usage = _Rounded(usage / _KILO_UNIT, decimals)
67
- unit = "KB"
68
- elif unit == "m":
69
- usage = _Rounded(usage / _MEGA_UNIT, decimals)
70
- unit = "MB"
71
- elif unit == "g":
72
- usage = _Rounded(usage / _GIGA_UNIT, decimals)
73
- unit = "GB"
74
- elif unit == "a":
75
- usage, unit = WithAutoUnit(usage, decimals)
76
-
77
- return usage, unit
78
-
79
-
80
- def MaximumUsage(
81
- *, unit: Literal["b", "k", "m", "g", "a"] | None = "a", decimals: int = None
82
- ) -> tuple[int | float, str]:
83
- """
84
- unit: b or None=bytes, k=kilo, m=mega, g=giga, a=auto
85
- """
86
- usage = max(getattr(_hdr, "max_memory_usage", -1) for _hdr in LOGGER.handlers)
87
- return FormattedUsage(usage, unit=unit, decimals=decimals)
88
-
89
-
90
- def WithAutoUnit(usage: int, decimals: int | None, /) -> tuple[int | float, str]:
91
- """"""
92
- if usage > _GIGA_UNIT:
93
- return _Rounded(usage / _GIGA_UNIT, decimals), "GB"
94
-
95
- if usage > _MEGA_UNIT:
96
- return _Rounded(usage / _MEGA_UNIT, decimals), "MB"
97
-
98
- if usage > _KILO_UNIT:
99
- return _Rounded(usage / _KILO_UNIT, decimals), "KB"
100
-
101
- return usage, "B"
102
-
103
-
104
- def _Rounded(value: float, decimals: int | None, /) -> int | float:
105
- """"""
106
- if decimals == 0:
107
- decimals = None
108
-
109
- return round(value, ndigits=decimals)
@@ -1,84 +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
-
34
- from logger_36.instance import LOGGER
35
- from logger_36.task.inspection import Modules
36
-
37
- SYSTEM_DETAILS = (
38
- "node",
39
- "machine",
40
- "processor",
41
- "architecture",
42
- #
43
- "system",
44
- "release",
45
- "version",
46
- "platform",
47
- #
48
- "python_implementation",
49
- "python_version",
50
- "python_revision",
51
- "python_branch",
52
- "python_compiler",
53
- "python_build",
54
- )
55
-
56
- SYSTEM_DETAILS_AS_DICT = {
57
- _dtl.capitalize(): getattr(pltf, _dtl)() for _dtl in SYSTEM_DETAILS
58
- }
59
- MAX_DETAIL_NAME_LENGTH = max(map(len, SYSTEM_DETAILS_AS_DICT.keys()))
60
-
61
-
62
- def LogSystemDetails(
63
- *,
64
- modules_with_version: bool = True,
65
- modules_formatted: bool = True,
66
- should_restrict_modules_to_loaded: bool = True,
67
- ) -> None:
68
- """"""
69
- details = "\n".join(
70
- f" {_key:>{MAX_DETAIL_NAME_LENGTH}}: {_vle}"
71
- for _key, _vle in SYSTEM_DETAILS_AS_DICT.items()
72
- )
73
- modules = Modules(
74
- modules_with_version,
75
- modules_formatted,
76
- only_loaded=should_restrict_modules_to_loaded,
77
- )
78
-
79
- LOGGER.info(
80
- f"SYSTEM DETAILS\n"
81
- f"{details}\n"
82
- f" {'Python Modules':>{MAX_DETAIL_NAME_LENGTH}}:\n"
83
- f" {modules}"
84
- )
logger_36/config.py DELETED
@@ -1,48 +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
-
40
- MESSAGE_FORMAT = (
41
- f"%(asctime)s{LEVEL_OPENING}%(levelname)s{LEVEL_CLOSING}\t"
42
- f"{CONTEXT_SEPARATOR}"
43
- f"%(message)s "
44
- f"{WHERE_SEPARATOR} %(module)s:%(funcName)s:%(lineno)d "
45
- f"{ELAPSED_TIME_SEPARATOR}%(elapsed_time)s"
46
- f"%(memory_usage)s"
47
- )
48
- DATE_TIME_FORMAT = "%Y-%m-%d@%H:%M:%S"
logger_36/constant.py DELETED
@@ -1,52 +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
- from datetime import datetime as dttm
33
-
34
- from logger_36.config import (
35
- CONTEXT_SEPARATOR,
36
- DATE_TIME_FORMAT,
37
- LEVEL_CLOSING,
38
- LEVEL_OPENING,
39
- )
40
-
41
- # This module is certainly imported early. Therefore, the current time should be close
42
- # enough to the real start time.
43
- START_TIME = dttm.now()
44
-
45
- DATE_TIME_LENGTH = START_TIME.strftime(DATE_TIME_FORMAT).__len__()
46
- LOG_LEVEL_LENGTH = (
47
- max(map(len, ("DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL")))
48
- + LEVEL_OPENING.__len__()
49
- + LEVEL_CLOSING.__len__()
50
- )
51
- CONTEXT_LENGTH = DATE_TIME_LENGTH + LOG_LEVEL_LENGTH
52
- NEXT_LINE_PROLOGUE = "\n" + (CONTEXT_LENGTH + CONTEXT_SEPARATOR.__len__() + 1) * " "