28 lines
701 B
Python
28 lines
701 B
Python
import sys
|
|
from logging.config import dictConfig
|
|
from typing import Any, Dict
|
|
|
|
DEFAULT_LOGGING_CONFIG: Dict[str, Any] = {
|
|
"version": 1,
|
|
"formatters": {
|
|
"simple": {
|
|
"format": "[%(asctime)s] [%(levelname)s] [%(name)s.%(funcName)s:%(lineno)d] [PID:%(process)d] %(message)s",
|
|
},
|
|
},
|
|
"filters": {},
|
|
"handlers": {
|
|
"console": {
|
|
"class": "logging.StreamHandler",
|
|
"formatter": "simple",
|
|
"filters": [],
|
|
"stream": sys.stdout,
|
|
},
|
|
},
|
|
"root": {"handlers": ["console"], "level": "INFO"},
|
|
}
|
|
|
|
|
|
def configure_logging():
|
|
"""Configure with default logging"""
|
|
dictConfig(DEFAULT_LOGGING_CONFIG)
|