feat(logging): enhance logging configuration and file handling
- Updated the maximum log file size to 10MB and reduced backup count to 5. - Introduced a `per_run` option to generate independent log files for each run. - Improved log file naming conventions based on the `per_run` setting. - Added support for both size-based and time-based log rotation configurations. - Implemented error handling for OCR click execution in `douyin_helpers.py`. - Added new CSV report for OCR regions and updated logging for click actions. - Introduced a temporary script to check logging configurations and handlers. - Added a new log file for unified logs dated 2025-12-27. - Updated reservations timestamp in JSON state file.
This commit is contained in:
1 parent
25ed50cc3c
commit
3d93f7f723
8 files changed
+486
-351
No files matched your search
@@ -0,0 +1,20 @@
|
||||
from douyin.logging import douyin_logging
|
||||
import logging
|
||||
import logging.handlers as lh
|
||||
|
||||
# Configure logging using current config
|
||||
douyin_logging.configure_logging()
|
||||
root = logging.getLogger()
|
||||
print('handlers:', [type(h).__name__ for h in root.handlers])
|
||||
|
||||
for h in root.handlers:
|
||||
fname = getattr(h, 'baseFilename', getattr(h, 'filename', None))
|
||||
print(type(h).__name__, fname)
|
||||
# RotatingDatedFileHandler specific
|
||||
if hasattr(h, 'max_bytes'):
|
||||
print(' max_bytes =', getattr(h, 'max_bytes', None), 'backup_count =', getattr(h, 'backup_count', None))
|
||||
# RotatingFileHandler
|
||||
if isinstance(h, lh.RotatingFileHandler):
|
||||
print(' RotatingFileHandler maxBytes =', getattr(h, 'maxBytes', None), 'backupCount =', getattr(h, 'backupCount', None))
|
||||
if isinstance(h, lh.TimedRotatingFileHandler):
|
||||
print(' TimedRotating when =', getattr(h, 'when', None), 'interval =', getattr(h, 'interval', None), 'backupCount =', getattr(h, 'backupCount', None))
|
||||
Reference in new issue
Block a user