forgejo-init-script/forgejo/logger.py

18 lines
401 B
Python
Raw Normal View History

2023-10-05 00:22:07 +05:30
import logging
def configure_logger():
logger = logging.getLogger("forgejo-installer")
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter(
"%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
ch.setFormatter(formatter)
logger.addHandler(ch)
return logger
logger = configure_logger()