mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-17 15:13:24 +02:00
refactor logging configuration: use constant for log level
This commit is contained in:
@@ -12,7 +12,7 @@ class ISOJsonFormatter(JsonFormatter):
|
||||
dt = datetime.fromtimestamp(record.created, tz=timezone.utc)
|
||||
return dt.isoformat(timespec="milliseconds").replace("+00:00", "Z")
|
||||
|
||||
|
||||
LOG_LEVEL = logging.DEBUG
|
||||
LOG_FILE = Path(os.getenv("LOG_FILE", "/app/config/media_manager.log"))
|
||||
LOGGING_CONFIG = {
|
||||
"version": 1,
|
||||
@@ -47,7 +47,7 @@ LOGGING_CONFIG = {
|
||||
},
|
||||
},
|
||||
"root": {
|
||||
"level": "DEBUG",
|
||||
"level": LOG_LEVEL,
|
||||
"handlers": ["console", "file"],
|
||||
},
|
||||
"loggers": {
|
||||
@@ -59,7 +59,7 @@ LOGGING_CONFIG = {
|
||||
dictConfig(LOGGING_CONFIG)
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.DEBUG,
|
||||
level=LOG_LEVEL,
|
||||
format="%(asctime)s - %(levelname)s - %(name)s - %(funcName)s(): %(message)s",
|
||||
stream=sys.stdout,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user