modify scripts
This commit is contained in:
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user