add log config to __init__.py
This commit is contained in:
parent
0bdf5a726a
commit
c1ae8e6a4b
@ -0,0 +1,13 @@
|
||||
import logging
|
||||
import sys
|
||||
|
||||
# log config
|
||||
LOG_FORMAT = "%(asctime)s [%(levelname)s] - [%(filename)s -> %(funcName)s() -> %(lineno)s] : %(message)s"
|
||||
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
|
||||
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(__name__)
|
||||
logger.propagate = False
|
||||
logger.addHandler(stream_handler)
|
||||
Loading…
x
Reference in New Issue
Block a user