Skip to main content

Loguru Logging Intercept

PyPI - Version PyPI - Downloads

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)

Source distribution for loguru-logging-intercept 0.1.7
File Size Uploaded
loguru_logging_intercept-0.1.7.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for loguru-logging-intercept 0.1.7
File Interpreter ABI Platform
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}

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.5

2 release files

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page