First version
This commit is contained in:
parent
cabbfa4f47
commit
f415aed975
15
pyproject.toml
Normal file
15
pyproject.toml
Normal 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"
|
||||
3
uvicorn_logger_config/__init__.py
Normal file
3
uvicorn_logger_config/__init__.py
Normal file
@ -0,0 +1,3 @@
|
||||
from .config import LOGGING_CONFIG, logger
|
||||
|
||||
__all__ = ["LOGGING_CONFIG", "logger"]
|
||||
25
uvicorn_logger_config/config.py
Normal file
25
uvicorn_logger_config/config.py
Normal 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"]
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user