forked from zero-to-mastery/ascii-art-2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger_config.py
31 lines (28 loc) · 870 Bytes
/
logger_config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import logging
ERROR_LOG_FILENAME = ".text-ascii-art-errors.log"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"default": {
"format": "%(asctime)s:%(name)s:%(process)d:%(lineno)d " "%(levelname)s %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
}
},
"handlers": {
"logfile": {
"class": "logging.handlers.RotatingFileHandler",
"level": "ERROR",
"filename": ERROR_LOG_FILENAME,
"formatter": "default",
"backupCount": 2,
},
"verbose_output": {
"class": "logging.StreamHandler",
"level": "DEBUG",
"formatter": "default",
"stream": "ext://sys.stdout",
}
},
"root": {"level": "INFO", "handlers": ["logfile", "verbose_output"]},
}