Uvicorn Loguru Integration
Code to integrate uvicorn.run with Loguru logging
Loguru is a great alternative logging library for Python. However, since Uvicorn uses Python's standard logging library, using Loguru looks inconsistent. This module injects an intercept handler in the correct location after initializing Uvicorn so that all logs get routed through Loguru.
Usage
Call run_uvicorn_loguru with an instance of uvicorn.Config:
from uvicorn_loguru_integration import run_uvicorn_loguru
def main():
run_uvicorn_loguru(
uvicorn.Config(
"myapp:app",
host="0.0.0.0",
port=8000,
log_level="info",
reload=True,
)
)
if __name__ == "__main__":
main()
Installation
Install via pip or uv:
pip3 install uvicorn-loguru-integration
# or
uv pip install uvicorn-loguru-integration
Metadata
Release files for uvicorn-loguru-integration 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| uvicorn_loguru_integration-0.3.3.tar.gz | 3.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| uvicorn_loguru_integration-0.3.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.7 kB
Release files / uvicorn_loguru_integration-0.3.3.tar.gz
| Download URL | uvicorn_loguru_integration-0.3.3.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d030477a10bdade254035b0c667fdade8bbf6e1aa86ae686c8763ff44e36f3d1
|
|
BLAKE2b-256 checksum How to use checksums |
a4ccb4fe5c5660095b39008cf7be37db90bcaedd07aad2ea5433f2bf8c5eae56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / uvicorn_loguru_integration-0.3.3-py3-none-any.whl
| Download URL | uvicorn_loguru_integration-0.3.3-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4088b692ed677be965c91c9e6c33f8a8ee9cae9b3ddb15335d1f23ff9f33db75
|
|
BLAKE2b-256 checksum How to use checksums |
54355439ca2462521076fc9737a04d46509ba88d2da8e5edc1748a6c6754f082
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|