vieuxhibou-django (1.0.0)
Installation
pip install --index-url vieuxhibou-djangoAbout this package
Logging structuré, registre de loggers modifiables à chaud et enregistrement auprès de vieuxhibou pour les projets Django
vieuxhibou-django
Structured logging for Django: a registry of already-instantiated Python loggers, hot-reloadable (NOTSET/DEBUG/INFO/WARNING/ERROR/CRITICAL level, no process restart needed), plus optional registration/heartbeat with a central vieuxhibou server to drive those levels remotely from a dashboard shared with vieuxhibou-gin services.
Installation
pip install vieuxhibou-django
# settings.py
INSTALLED_APPS = [
...,
"vieuxhibou",
]
VIEUXHIBOU_SERVICE_NAME = "my-service"
VIEUXHIBOU_ENV = "prod"
VIEUXHIBOU_VERSION = "1.2.3"
# Optional: registration with a central vieuxhibou server.
# Leaving this empty disables registration/heartbeat (the logger
# registry stays usable locally either way).
VIEUXHIBOU_SERVER_URL = "https://vieuxhibou.example.org"
VIEUXHIBOU_SELF_URL = "https://my-service.example.org"
VIEUXHIBOU_SHARED_TOKEN = "..."
VIEUXHIBOU_HEARTBEAT_INTERVAL = 30 # seconds
python manage.py migrate
The vieuxhibou.urls routes (dashboard + /loggers/ API) need to be
mounted into the host project's urlconf, for example:
# urls.py
urlpatterns = [
...,
path("vieuxhibou/", include("vieuxhibou.urls")),
]
Level changes applied through the API are persisted (LoggerOverride)
and automatically reapplied the next time the process starts.
Development
make dev # venv + pip install -e ".[dev]"
make test # pytest, via tox
make lint # pylint (+ pylint-django)
make format-check # autopep8 --diff (CI)
make format # autopep8 --in-place (local)
make bandit # static security analysis
make tox # all tox environments at once
License
LGPLv3, see COPYING + COPYING.LESSER -- chosen over GPLv3 specifically because this package is meant to be imported (i.e. "linked", in the LGPL sense) by projects that have no reason of their own to be GPL.