import logging, sys
from config import Config

# Logging config section

LOG_TO = sys.stdout
LOG_LEVEL = logging.DEBUG

logger = logging.getLogger(Config.APP_NAME)
logger.setLevel(LOG_LEVEL)
stdout_handler = logging.StreamHandler(LOG_TO)
stdout_handler.setLevel(LOG_LEVEL)
formatter = logging.Formatter(
    '[%(asctime)s] %(name)s: %(levelname)s: %(message)s',
    datefmt='%Y-%m-%d %H:%M:%S'
)
stdout_handler.setFormatter(formatter)
if not logger.hasHandlers():
    logger.addHandler(stdout_handler)
logger.propagate = False