1. 初始化代码;

This commit is contained in:
2025-12-30 22:42:47 +08:00
parent 2a75e5acb5
commit aed4f68b0d
11 changed files with 268 additions and 168 deletions

0
confs/__init__.py Normal file
View File

39
confs/logging.conf Normal file
View File

@@ -0,0 +1,39 @@
# logging.conf
[loggers]
keys=root,my_module
[handlers]
keys=consoleHandler,fileHandler
[formatters]
keys=simpleFormatter,detailedFormatter
[logger_root]
level=INFO
handlers=consoleHandler
[logger_my_module]
level=DEBUG
qualname=my_module
handlers=fileHandler
propagate=0
[handler_consoleHandler]
class=StreamHandler
level=INFO
formatter=simpleFormatter
args=(sys.stdout,)
[handler_fileHandler]
class=FileHandler
level=DEBUG
formatter=detailedFormatter
args=('app.log', 'a')
[formatter_simpleFormatter]
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
datefmt=%Y-%m-%d %H:%M:%S
[formatter_detailedFormatter]
format=%(asctime)s - %(name)s - %(levelname)s - %(module)s:%(lineno)d - %(message)s
datefmt=%Y-%m-%d %H:%M:%S