forked from KRunchPL/script-args-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogging_setup.py
36 lines (34 loc) · 895 Bytes
/
logging_setup.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
"""
Logging configuration used in example.
"""
from logging.config import dictConfig
def setup_logging() -> None:
"""
Set up logging, so library emited logs are shown on console.
"""
dictConfig({
'version': 1,
'formatters': {
'detailed': {
'class': 'logging.Formatter',
'format': '%(asctime)s %(name)s %(levelname)s %(message)s',
},
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'level': 'DEBUG',
'formatter': 'detailed',
},
},
'loggers': {
'script_args_parser': {
'handlers': ['console'],
'propagate': False,
},
},
'root': {
'level': 'DEBUG',
'handlers': ['console'],
},
})