logger-36 2024.3__py3-none-any.whl → 2024.4__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/type/logger.py CHANGED
@@ -34,6 +34,7 @@ from __future__ import annotations
34
34
  import dataclasses as dtcl
35
35
  import logging as lggg
36
36
  import sys as sstm
37
+ import traceback as tbck
37
38
  import types as t
38
39
  import typing as h
39
40
  from datetime import datetime as dttm
@@ -271,7 +272,7 @@ class logger_t(lggg.Logger):
271
272
 
272
273
  def CommitIssues(
273
274
  self,
274
- level: int,
275
+ level: int | type[Exception],
275
276
  /,
276
277
  *,
277
278
  order: order_h = "when",
@@ -295,6 +296,19 @@ class logger_t(lggg.Logger):
295
296
  issues = sorted(self.staged_issues, key=lambda _elm: _elm.context)
296
297
  issues = "\n".join(issues)
297
298
 
299
+ if issubclass(level, Exception):
300
+ try:
301
+ raise level("\n" + issues)
302
+ except Exception as exception:
303
+ traceback = "Traceback (most recent call last):\n" + "\n".join(
304
+ tbck.format_stack()[:-1]
305
+ )
306
+ print(traceback[:-1], file=sstm.stderr)
307
+ print(
308
+ "\n".join(tbck.format_exception_only(exception)), file=sstm.stderr
309
+ )
310
+ sstm.exit(1)
311
+
298
312
  self.log(level, issues, **HIDE_WHERE_KWARG)
299
313
  self.staged_issues.clear()
300
314
 
logger_36/version.py CHANGED
@@ -29,4 +29,4 @@
29
29
  # The fact that you are presently reading this means that you have had
30
30
  # knowledge of the CeCILL license and that you accept its terms.
31
31
 
32
- __version__ = "2024.3"
32
+ __version__ = "2024.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: logger-36
3
- Version: 2024.3
3
+ Version: 2024.4
4
4
  Summary: Simple logger with a catalog of handlers
5
5
  Home-page: https://src.koda.cnrs.fr/eric.debreuve/logger-36/
6
6
  Author: Eric Debreuve
@@ -1,7 +1,7 @@
1
1
  logger_36/__init__.py,sha256=-VGyte6TD6SWU4jBXUjur_xU1R1Asha5KXEwDNmGJ6Q,1756
2
2
  logger_36/instance.py,sha256=NQlDAyXV3TNekX9xj9V7JMePmsa2DWnTDaVzh5dcyGM,1616
3
3
  logger_36/main.py,sha256=hj3hctMBHJbPWw1078tJ_zOU-6-kEGCzMgHwpWY5ElA,6134
4
- logger_36/version.py,sha256=qsHEd1MYxDfYmVO_dHrGsY9g8pdcOEwb2wSkuVGS1ws,1575
4
+ logger_36/version.py,sha256=b61fTunI_uzuupVlwY9m5iA0uH2qcxIRpuMvNp6g3BQ,1575
5
5
  logger_36/catalog/config/console_rich.py,sha256=jJnYXPDsMCTu8zny2X3NdeyKFCfhJupberqIBxyv3LA,2030
6
6
  logger_36/catalog/handler/console.py,sha256=PnaCWJsXN-x_-X8i-4o4HWys-7K0A83s4kIdtmDz3AQ,3092
7
7
  logger_36/catalog/handler/console_rich.py,sha256=YqKyKwHoYCEVnW1S87NDu3ReTCIzSdYgC-20-813TFQ,5395
@@ -32,8 +32,8 @@ logger_36/task/measure/chronos.py,sha256=qT80jxZm_dAg2P4WkfU0L3PRvRojT21Ps3DtNYq
32
32
  logger_36/task/measure/memory.py,sha256=1f1X-XHd_58LJYJ0Ok5TGIagnf0k5F39IFqWHN2Ojas,1874
33
33
  logger_36/type/extension.py,sha256=fsYx0wT1bR6DtpM2VnaxsM0MFv2vBLROgRSCs4duasY,5198
34
34
  logger_36/type/issue.py,sha256=T1WFtc8Js1OChYkIHQiOP825Dcb9atpEprLWaPTxAHA,2151
35
- logger_36/type/logger.py,sha256=eoSFZL4b8vB370bcfi0QUa_xsjZXwUoxDy_M38vawZQ,12187
36
- logger_36-2024.3.dist-info/METADATA,sha256=SCsGBauGyMu7xto-BNhLCGLB3xFm9-ZVw2zl9OgYEZA,4236
37
- logger_36-2024.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
38
- logger_36-2024.3.dist-info/top_level.txt,sha256=sM95BTMWmslEEgR_1pzwZsOeSp8C_QBiu8ImbFr0XLc,10
39
- logger_36-2024.3.dist-info/RECORD,,
35
+ logger_36/type/logger.py,sha256=jCmY-pxPT-4XLUpBNd81mPHasJZNVl5CaLEjLZyrCco,12731
36
+ logger_36-2024.4.dist-info/METADATA,sha256=_zL8RSuzNN7ruojiwBQol923L0t0oTZ9pcrGc1ELvtc,4236
37
+ logger_36-2024.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
38
+ logger_36-2024.4.dist-info/top_level.txt,sha256=sM95BTMWmslEEgR_1pzwZsOeSp8C_QBiu8ImbFr0XLc,10
39
+ logger_36-2024.4.dist-info/RECORD,,