Loguru Logging Intercept
Code to integrate Loguru with Python's standard logging module
Loguru is a great alternative logging library for
Python. However, if you use (potentially external) code that already integrates with
Python's default logger, you'll get a combination of the two logging styles. This code
provides a function that sets up an intercept handler to route calls to Python's
default logging module to Loguru.
Usage
Before calls that use Python's default logging module, call the provided
setup_loguru_logging_intercept() as shown below:
import logging
from loguru_logging_intercept import setup_loguru_logging_intercept
def main():
setup_loguru_logging_intercept(
level=logging.DEBUG,
modules=("foo", "foo.bar", "foo.baz")
)
# Can now call functions from foo that use getLogger(__name__)
...
Installation
Install via pip or uv:
pip3 install loguru-logging-intercept
# or
uv pip install loguru-logging-intercept
Metadata
Release files for loguru-logging-intercept 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| loguru_logging_intercept-0.1.7.tar.gz | 3.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| loguru_logging_intercept-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.9 kB
Release files / loguru_logging_intercept-0.1.7.tar.gz
| Download URL | loguru_logging_intercept-0.1.7.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e509c8a8ad6a7f412cead9b0f6ab2a3f58e0b4ef0f137df4214889b65dd34eee
|
|
BLAKE2b-256 checksum How to use checksums |
684aebb27a793eb8103ede2c172cbb3e5aaf8065713821a228f277f10556e69c
|
| 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 / loguru_logging_intercept-0.1.7-py3-none-any.whl
| Download URL | loguru_logging_intercept-0.1.7-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
017b0a47c019d22f9cb4737aa1a21f02a089751077b0ea8ff1e819da49974d61
|
|
BLAKE2b-256 checksum How to use checksums |
4e9f9a3cba424418be9c2a5a8426bc6682a5b764ad58be93689b30e8cf16a20d
|
| 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}
|