Spaces:
Build error
Build error
Download src/deep_barcode_reader/logging.py from afshin-dini/Deep-Barcode-Reader: direct link, hf CLI and curl.
- Browser
- Download file 832 Bytes
-
https://huggingface.co/spaces/afshin-dini/Deep-Barcode-Reader/resolve/main/src/deep_barcode_reader/logging.py
- Command line
-
hf download hf://spaces/afshin-dini/Deep-Barcode-Reader/src/deep_barcode_reader/logging.py
-
curl -L -o logging.py https://huggingface.co/spaces/afshin-dini/Deep-Barcode-Reader/resolve/main/src/deep_barcode_reader/logging.py
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) | |