12 lines
514 B
Python
12 lines
514 B
Python
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)
|