afshin-dini's picture
Update the main code to have the detection results in data as well as img type
1b8dd75
raw
history blame contribute delete
832 Bytes
"""Logger initialization"""
import logging
import logging.config
from typing import Any
def config_logger(loglevel: int) -> Any:
"""Initialize a custom logger"""
default_logging_config = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s - [%(levelname)s] [%(name)s.%(funcName)s:%(lineno)d (%(process)d)] | %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S",
},
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"formatter": "standard",
},
},
"root": {
"handlers": ["console"],
"level": loglevel,
},
}
logging.config.dictConfig(default_logging_config)