anki-csv2ankicards/logging_config.py

12 lines
514 B
Python
Raw Normal View History

2023-09-11 17:02:17 +00:00
import logging
def setup_logging():
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s [%(levelname)s] - %(module)s: %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
# If you also want to save logs to a file, you can add the below lines.
# file_handler = logging.FileHandler('ankiai.log')
# file_handler.setFormatter(logging.Formatter('%(asctime)s [%(levelname)s] - %(module)s: %(message)s'))
# logging.getLogger().addHandler(file_handler)