mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-10 06:42:49 +02:00
feat: dynamically handle root and procrastinate logs separately
This commit is contained in:
+59
-24
@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/5.1/ref/settings/
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
@@ -268,33 +269,67 @@ SPECTACULAR_SETTINGS = {
|
|||||||
# OTHER SETTINGS
|
# OTHER SETTINGS
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGING = {
|
if "procrastinate" in sys.argv:
|
||||||
"version": 1,
|
LOGGING = {
|
||||||
"disable_existing_loggers": False,
|
"version": 1,
|
||||||
"formatters": {
|
"disable_existing_loggers": False,
|
||||||
"procrastinate": {"format": "%(asctime)s %(levelname)-7s %(name)s %(message)s"},
|
"formatters": {
|
||||||
},
|
"procrastinate": {
|
||||||
"handlers": {
|
"format": "%(asctime)s %(levelname)-7s %(name)s %(message)s"
|
||||||
"procrastinate": {
|
},
|
||||||
"level": "DEBUG",
|
|
||||||
"class": "logging.StreamHandler",
|
|
||||||
"formatter": "procrastinate",
|
|
||||||
},
|
},
|
||||||
"console": {
|
"handlers": {
|
||||||
"class": "logging.StreamHandler",
|
"procrastinate": {
|
||||||
|
"level": "DEBUG",
|
||||||
|
"class": "logging.StreamHandler",
|
||||||
|
"formatter": "procrastinate",
|
||||||
|
},
|
||||||
|
"console": {
|
||||||
|
"class": "logging.StreamHandler",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
"loggers": {
|
||||||
"loggers": {
|
"procrastinate": {
|
||||||
"procrastinate": {
|
"handlers": ["procrastinate"],
|
||||||
"handlers": ["procrastinate"],
|
"level": "INFO",
|
||||||
"level": "INFO",
|
"propagate": False,
|
||||||
"propagate": False,
|
},
|
||||||
|
"root": {
|
||||||
|
"handlers": ["console"],
|
||||||
|
"level": "INFO",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"root": {
|
}
|
||||||
"handlers": ["console"],
|
else:
|
||||||
"level": "INFO",
|
LOGGING = {
|
||||||
|
"version": 1,
|
||||||
|
"disable_existing_loggers": False,
|
||||||
|
"formatters": {
|
||||||
|
"procrastinate": {
|
||||||
|
"format": "%(asctime)s %(levelname)-7s %(name)s %(message)s"
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
"handlers": {
|
||||||
}
|
"procrastinate": {
|
||||||
|
"level": "DEBUG",
|
||||||
|
"class": "logging.StreamHandler",
|
||||||
|
"formatter": "procrastinate",
|
||||||
|
},
|
||||||
|
"console": {
|
||||||
|
"class": "logging.StreamHandler",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"loggers": {
|
||||||
|
"procrastinate": {
|
||||||
|
"handlers": None,
|
||||||
|
"level": "INFO",
|
||||||
|
"propagate": False,
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"handlers": ["console"],
|
||||||
|
"level": "INFO",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
CACHALOT_UNCACHABLE_TABLES = ("django_migrations", "procrastinate_jobs")
|
CACHALOT_UNCACHABLE_TABLES = ("django_migrations", "procrastinate_jobs")
|
||||||
|
|||||||
Reference in New Issue
Block a user