-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogging_config.py
33 lines (30 loc) · 977 Bytes
/
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
import logging
import logging.config
def setup_logging():
"""Set up logging configuration."""
logging.config.dictConfig(
{
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"formatter": "standard",
"level": logging.INFO,
"stream": "ext://sys.stdout",
},
},
"root": {
"handlers": ["console"],
"level": logging.INFO,
},
}
)
logging.getLogger("py4j").setLevel(logging.ERROR)
logging.getLogger("py4j.java_gateway").setLevel(logging.ERROR)