forked from samwize/python-email-crawler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
49 lines (42 loc) · 1.09 KB
/
settings.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import logging
DEBUG = True # Whether or not to show DEBUG level messages
USE_COLORS = True # Whether or not colors should be used when outputting text
LOGGING = { # dictConfig for output stream and file logging
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'console': {
'format': '[%(asctime)s] %(levelname)s::%(module)s - %(message)s',
},
'file': {
'format': '[%(asctime)s] %(levelname)s::(P:%(process)d T:%(thread)d)::%(module)s - %(message)s',
},
},
'handlers': {
'console': {
'class': 'ColorStreamHandler.ColorStreamHandler',
'formatter':'console',
'level': 'DEBUG',
'use_colors': USE_COLORS,
},
'file': {
'class': 'logging.handlers.TimedRotatingFileHandler',
'formatter':'file',
'level': 'INFO',
'when': 'midnight',
'filename': 'logs/pycrawler.log',
'interval': 1,
'backupCount': 0,
'encoding': None,
'delay': False,
'utc': False,
},
},
'loggers': {
'crawler_logger': {
'handlers': ['console', 'file'],
'level': 'DEBUG' if DEBUG else 'INFO',
'propagate': True,
},
}
}