feat: Docker image
This commit is contained in:
parent
6455087893
commit
4fcd7bc49d
3 changed files with 96 additions and 0 deletions
|
|
@ -67,6 +67,10 @@ class HandlerFactory:
|
|||
return handler
|
||||
|
||||
def file_handler(prefix: str = ''):
|
||||
if not file_path:
|
||||
raise ValueError("File path must be set.")
|
||||
file_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
file_path.touch(exist_ok=True)
|
||||
handler = TimedRotatingFileHandler(file_path, when='midnight', backupCount=30)
|
||||
handler.setFormatter(ApplicationFormatter(prefix))
|
||||
handler.setLevel('TRACE')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue