2727
2828
2929def init_app (app = None , * , aelog_access_file : str = None , aelog_error_file : str = None ,
30- aelog_console : bool = True , loglevel : str = "DEBUG" ,
30+ aelog_console : bool = True , aelog_level : str = "DEBUG" ,
3131 aelog_max_bytes : int = MAX_BYTES , aelog_backup_count : int = BACKUP_COUNT ):
3232 """
3333 init global logging
@@ -38,7 +38,7 @@ def init_app(app=None, *, aelog_access_file: str = None, aelog_error_file: str =
3838 app: app 应用
3939 aelog_access_file: access log full file
4040 aelog_error_file: error log full file
41- loglevel : log level, default debug
41+ aelog_level : log level, default debug
4242 aelog_console: terminal output log
4343 aelog_max_bytes: log file max bytes
4444 aelog_backup_count: backup count
@@ -49,14 +49,15 @@ def init_app(app=None, *, aelog_access_file: str = None, aelog_error_file: str =
4949 aelog_access_file = app .config .get ("AELOG_ACCESS_FILE" , None ) or aelog_access_file
5050 aelog_error_file = app .config .get ("AELOG_ERROR_FILE" , None ) or aelog_error_file
5151 aelog_console = app .config .get ("AELOG_CONSOLE" , None ) or aelog_console
52+ aelog_level = app .config .get ("AELOG_LEVEL" , None ) or aelog_level
5253 aelog_max_bytes = app .config .get ("AELOG_MAX_BYTES" , None ) or aelog_max_bytes
5354 aelog_backup_count = app .config .get ("AELOG_BACKUP_COUNT" , None ) or aelog_backup_count
5455
5556 if aelog_access_file is None :
56- aelog_conf = aelog_default_config (loglevel = loglevel )
57+ aelog_conf = aelog_default_config (loglevel = aelog_level )
5758 else :
5859 aelog_conf = aelog_config (aelog_access_file , error_file = aelog_error_file , console = aelog_console ,
59- loglevel = loglevel , max_bytes = aelog_max_bytes , backup_count = aelog_backup_count )
60+ loglevel = aelog_level , max_bytes = aelog_max_bytes , backup_count = aelog_backup_count )
6061 dictConfig (aelog_conf )
6162
6263
0 commit comments