dycw-utilities 0.129.4__py3-none-any.whl → 0.129.6__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.
- {dycw_utilities-0.129.4.dist-info → dycw_utilities-0.129.6.dist-info}/METADATA +1 -1
- {dycw_utilities-0.129.4.dist-info → dycw_utilities-0.129.6.dist-info}/RECORD +6 -6
- utilities/__init__.py +1 -1
- utilities/logging.py +19 -11
- {dycw_utilities-0.129.4.dist-info → dycw_utilities-0.129.6.dist-info}/WHEEL +0 -0
- {dycw_utilities-0.129.4.dist-info → dycw_utilities-0.129.6.dist-info}/licenses/LICENSE +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
utilities/__init__.py,sha256=
|
1
|
+
utilities/__init__.py,sha256=Odk_y5HDH2OquSZJAdWdoTST_nZpx27fTwquoNg32dI,60
|
2
2
|
utilities/altair.py,sha256=Gpja-flOo-Db0PIPJLJsgzAlXWoKUjPU1qY-DQ829ek,9156
|
3
3
|
utilities/asyncio.py,sha256=3n5EIcSq2xtEF1i4oR0oY2JmBq3NyugeHKFK39Mt22s,37987
|
4
4
|
utilities/atomicwrites.py,sha256=geFjn9Pwn-tTrtoGjDDxWli9NqbYfy3gGL6ZBctiqSo,5393
|
@@ -29,7 +29,7 @@ utilities/iterables.py,sha256=mDqw2_0MUVp-P8FklgcaVTi2TXduH0MxbhTDzzhSBho,44915
|
|
29
29
|
utilities/jupyter.py,sha256=ft5JA7fBxXKzP-L9W8f2-wbF0QeYc_2uLQNFDVk4Z-M,2917
|
30
30
|
utilities/libcst.py,sha256=Jto5ppzRzsxn4AD32IS8n0lbgLYXwsVJB6EY8giNZyY,4974
|
31
31
|
utilities/lightweight_charts.py,sha256=0xNfcsrgFI0R9xL25LtSm-W5yhfBI93qQNT6HyaXAhg,2769
|
32
|
-
utilities/logging.py,sha256=
|
32
|
+
utilities/logging.py,sha256=9vo6vz4sDMoF2nkc8eT-eWpymBb5QboIu0kMhEwPiqk,25206
|
33
33
|
utilities/loguru.py,sha256=MEMQVWrdECxk1e3FxGzmOf21vWT9j8CAir98SEXFKPA,3809
|
34
34
|
utilities/luigi.py,sha256=fpH9MbxJDuo6-k9iCXRayFRtiVbUtibCJKugf7ygpv0,5988
|
35
35
|
utilities/math.py,sha256=-mQgbah-dPJwOEWf3SonrFoVZ2AVxMgpeQ3dfVa-oJA,26764
|
@@ -89,7 +89,7 @@ utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
|
|
89
89
|
utilities/whenever.py,sha256=jS31ZAY5OMxFxLja_Yo5Fidi87Pd-GoVZ7Vi_teqVDA,16743
|
90
90
|
utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
|
91
91
|
utilities/zoneinfo.py,sha256=-5j7IQ9nb7gR43rdgA7ms05im-XuqhAk9EJnQBXxCoQ,1874
|
92
|
-
dycw_utilities-0.129.
|
93
|
-
dycw_utilities-0.129.
|
94
|
-
dycw_utilities-0.129.
|
95
|
-
dycw_utilities-0.129.
|
92
|
+
dycw_utilities-0.129.6.dist-info/METADATA,sha256=tC_nJcnk-38KjYuNvAhfUg4mKnytwE71-7ndZfBs0bQ,12803
|
93
|
+
dycw_utilities-0.129.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
94
|
+
dycw_utilities-0.129.6.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
|
95
|
+
dycw_utilities-0.129.6.dist-info/RECORD,,
|
utilities/__init__.py
CHANGED
utilities/logging.py
CHANGED
@@ -160,13 +160,11 @@ class SizeAndTimeRotatingFileHandler(BaseRotatingHandler):
|
|
160
160
|
def _should_rollover(self, record: LogRecord, /) -> bool:
|
161
161
|
if self._max_bytes is not None: # skipif-ci-and-windows
|
162
162
|
try:
|
163
|
-
|
163
|
+
size = self._filename.stat().st_size
|
164
164
|
except FileNotFoundError:
|
165
165
|
pass
|
166
166
|
else:
|
167
|
-
|
168
|
-
new = current + delta
|
169
|
-
if new >= self._max_bytes:
|
167
|
+
if size >= self._max_bytes:
|
170
168
|
return True
|
171
169
|
return bool(self._time_handler.shouldRollover(record)) # skipif-ci-and-windows
|
172
170
|
|
@@ -417,16 +415,26 @@ def add_filters(handler: Handler, /, *filters: _FilterType) -> None:
|
|
417
415
|
|
418
416
|
def basic_config(
|
419
417
|
*,
|
420
|
-
|
418
|
+
logger: LoggerOrName | None = None,
|
419
|
+
format_: str = "{asctime} | {name} | {levelname:8} | {message}",
|
421
420
|
level: LogLevel = "INFO",
|
422
421
|
) -> None:
|
423
422
|
"""Do the basic config."""
|
424
|
-
|
425
|
-
|
426
|
-
datefmt=
|
427
|
-
|
428
|
-
|
429
|
-
|
423
|
+
datefmt = maybe_sub_pct_y("%Y-%m-%d %H:%M:%S")
|
424
|
+
if logger is None:
|
425
|
+
basicConfig(format=format_, datefmt=datefmt, style="{", level=level)
|
426
|
+
else:
|
427
|
+
logger_use = get_logger(logger=logger)
|
428
|
+
logger_use.setLevel(level)
|
429
|
+
logger_use.addHandler(handler := StreamHandler())
|
430
|
+
handler.setLevel(level)
|
431
|
+
try:
|
432
|
+
from coloredlogs import ColoredFormatter
|
433
|
+
except ModuleNotFoundError: # pragma: no cover
|
434
|
+
formatter = Formatter(fmt=format_, datefmt=datefmt, style="{")
|
435
|
+
else:
|
436
|
+
formatter = ColoredFormatter(fmt=format_, datefmt=datefmt, style="{")
|
437
|
+
handler.setFormatter(formatter)
|
430
438
|
|
431
439
|
|
432
440
|
##
|
File without changes
|
File without changes
|