atom-detection / app /logger.py
Romain Graux
Initial commit with ml code and webapp
b2ffc9b
raw
history blame
432 Bytes
import logging
name = 'atomdetection-app'
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
# Create a file handler and set its level and formatter
file_handler = logging.FileHandler(f'{name}.log')
file_handler.setLevel(logging.DEBUG)
file_handler.setFormatter(formatter)
# Add the file handler to the logger
logger.addHandler(file_handler)