Skip to main content

Loguru all over the world. | 全世界都在用 Lo~guru~~

Project description

Loguru Ever

PyPI version GitHub Latest

Use and replace logging to loguru everywhere!

Loguru used all over the world. | 全世界都在用 Loguru

Installation

You can install Loguru Ever from PyPI:

pip install EverLoguru

Usage

Loguru Ever is a simple package that replaces the standard logging module with loguru. Loguru is a modern and easy-to-use logging library for Python. With Loguru Ever, you can use loguru features in any module that uses logging, without changing any code.

To use Loguru Ever, you just need to import it and call the replace_logging function at the beginning of your program. This will replace the logging module in the sys.modules dictionary with loguru. After that, you can use loguru as usual.

For example, if you have a module called foo.py that uses logging:

import logging

logger = logging.getLogger(__name__)

def bar():
    logger.info("Hello from bar")

You can use Loguru Ever in your main script like this:

import ever_loguru
ever_loguru.install_class()

import foo

foo.bar()

This will output:

2021-12-15 16:13:49.123 | INFO     | foo:bar:5 - Hello from bar

Project details


Download files

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

Source Distribution

EverLoguru-1.1.6.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

EverLoguru-1.1.6-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page