-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.py
35 lines (31 loc) · 898 Bytes
/
log.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
import logging.config
def configure(env):
logging.config.dictConfig({
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format': '[%(asctime)s] [%(process)d] [%(levelname)s] %(name)s - %(message)s'
},
},
'handlers': {
'default': {
'class': 'logging.StreamHandler',
'formatter': 'standard'
},
},
'loggers': {
'root': {
'level': 'WARN',
'handlers': ['default']
},
'minder': {
'level': 'DEBUG' if env in ('dev', 'local', 'test') else 'INFO',
'handlers': ['default']
},
'rq.worker': {
'level': 'WARN',
'handlers': ['default']
}
}
})