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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loguru_logging_intercept-0.1.7.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loguru_logging_intercept-0.1.7-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file loguru_logging_intercept-0.1.7.tar.gz.

File metadata

  • Download URL: loguru_logging_intercept-0.1.7.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for loguru_logging_intercept-0.1.7.tar.gz
Algorithm Hash digest
SHA256 e509c8a8ad6a7f412cead9b0f6ab2a3f58e0b4ef0f137df4214889b65dd34eee
MD5 4f6e13d6d19f21188e36d80e90b6faa9
BLAKE2b-256 684aebb27a793eb8103ede2c172cbb3e5aaf8065713821a228f277f10556e69c

See more details on using hashes here.

File details

Details for the file loguru_logging_intercept-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: loguru_logging_intercept-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for loguru_logging_intercept-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 017b0a47c019d22f9cb4737aa1a21f02a089751077b0ea8ff1e819da49974d61
MD5 75858f577cc8582f7a0353786d30dd2a
BLAKE2b-256 4e9f9a3cba424418be9c2a5a8426bc6682a5b764ad58be93689b30e8cf16a20d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 files

0.1.5

2 files

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 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