-
Notifications
You must be signed in to change notification settings - Fork 3
/
logging_config.py
40 lines (39 loc) · 1.09 KB
/
logging_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
31
32
33
34
35
36
37
38
39
40
from paths import LOGS
def get_logging_config(run):
return {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'standard': {
'format': '%(asctime)s [%(levelname)s]: %(message)s'
},
'short': {
'format': '[%(levelname)s]: %(message)s'
},
},
'handlers': {
'default': {
'level': 'INFO',
'formatter': 'short',
'class': 'logging.StreamHandler',
},
'file': {
'level': 'DEBUG',
'formatter': 'standard',
'class': 'logging.FileHandler',
'filename': LOGS+run+'.log'
},
},
'loggers': {
'gan': {
'handlers': ['default', 'file'],
'level': 'DEBUG',
'propagate': True,
},
'tensorflow': {
'handlers': ['default', 'file'],
'level': 'DEBUG',
'propagate': True,
},
}
}