Added default config method
This commit is contained in:
parent
3b8fbbc084
commit
e85a309302
@ -29,6 +29,7 @@ report (Report Module)
|
||||
__DEPENDENCIES__ = []
|
||||
|
||||
import collections
|
||||
import config
|
||||
import json
|
||||
import logging
|
||||
from logging.config import dictConfig
|
||||
@ -200,6 +201,13 @@ def add_handler_socket(logger: logging.Logger, level: int = logging.DEBUG, host:
|
||||
logger.addHandler(handler)
|
||||
return handler
|
||||
|
||||
def default_logging_config():
|
||||
logger = logging.getLogger(ROOT_LOGGER_NAME)
|
||||
|
||||
add_handler_stdout(logger, config.LOG_LEVEL)
|
||||
if config.DEBUG:
|
||||
add_handler_socket(logger, host=config.LOG_HOSTNAME)
|
||||
|
||||
|
||||
def appLoggingConfigure(basepath, target, log_name_lvl=[], target_level=logging.DEBUG, fmt=SHORT_FMT, ring_logs=None, host=None, port=None):
|
||||
target_handlers = ['main', ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user