forgejo-init-script/forgejo/logger.py
Aravinth Manivannan 40899951ad
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat: use logging library to log
2023-10-05 00:22:07 +05:30

17 lines
401 B
Python

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()