update logging
This commit is contained in:
parent
22605a2b2e
commit
7f1a0ed188
10
src/serve.py
10
src/serve.py
@ -16,20 +16,14 @@ from pyinfra.storage.storage import get_storage
|
||||
PYINFRA_CONFIG = config.get_config()
|
||||
IMAGE_CONFIG = Config(CONFIG_FILE)
|
||||
|
||||
# logging.getLogger().addHandler(logging.StreamHandler())
|
||||
# logger = logging.getLogger("main")
|
||||
# logger.setLevel(PYINFRA_CONFIG.logging_level_root)
|
||||
|
||||
LOG_FORMAT = "%(asctime)s [%(levelname)s] - [%(filename)s -> %(funcName)s() -> %(lineno)s] : %(message)s"
|
||||
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
|
||||
|
||||
logger = logging.getLogger("main")
|
||||
logger.setLevel("DEBUG")
|
||||
|
||||
stream_handler = logging.StreamHandler(sys.stdout)
|
||||
stream_handler_format = logging.Formatter(LOG_FORMAT, datefmt=DATE_FORMAT)
|
||||
stream_handler.setFormatter(stream_handler_format)
|
||||
|
||||
logger = logging.getLogger("image-prediction/serve")
|
||||
logger.setLevel(PYINFRA_CONFIG.logging_level_root)
|
||||
logger.addHandler(stream_handler)
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user