First version

This commit is contained in:
Florian 2025-11-04 11:11:49 +01:00
parent cabbfa4f47
commit f415aed975
3 changed files with 43 additions and 0 deletions

15
pyproject.toml Normal file
View File

@ -0,0 +1,15 @@
[project]
name = "lib-uvicorn-config"
version = "0.1.0"
description = "Shared Uvicorn configuration module with logging support"
readme = "README.md"
requires-python = ">=3.10"
authors = [{ name = "Florian Gänsejunge" }]
dependencies = ["simple-logger-handler @ git+https://git.gansejunge.com/notifier/lib-logger-handler.git@main"]
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"
[project.urls]
Homepage = "https://git.gansejunge.com/notifier/lib-uvicorn-config"

View File

@ -0,0 +1,3 @@
from .config import LOGGING_CONFIG, logger
__all__ = ["LOGGING_CONFIG", "logger"]

View File

@ -0,0 +1,25 @@
from simple_logger_handler import setup_logger
logger = setup_logger(__name__)
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"default": {
"()": "pythonjsonlogger.jsonlogger.JsonFormatter",
"format": "%(asctime)s %(name)s %(levelname)s %(message)s",
}
},
"handlers": {
"default": {
"class": "logging.StreamHandler",
"formatter": "default",
"stream": "ext://sys.stdout",
}
},
"root": {
"level": logger.level,
"handlers": ["default"]
}
}