modify scripts

This commit is contained in:
oscarz
2025-03-24 10:27:52 +08:00
parent 7b9b37092b
commit b1ffd72f1c

View File

@ -52,6 +52,7 @@ def setup_logging(log_filename=None):
caller_frame = inspect.stack()[1] caller_frame = inspect.stack()[1]
caller_filename = os.path.splitext(os.path.basename(caller_frame.filename))[0] caller_filename = os.path.splitext(os.path.basename(caller_frame.filename))[0]
current_date = datetime.now().strftime('%Y%m%d') current_date = datetime.now().strftime('%Y%m%d')
os.makedirs(log_dir, exist_ok=True)
log_filename = f'{log_dir}/{caller_filename}_{current_date}.log' log_filename = f'{log_dir}/{caller_filename}_{current_date}.log'
max_log_size = 100 * 1024 * 1024 # 10 MB max_log_size = 100 * 1024 * 1024 # 10 MB