Skip to main content

Class-based logging facility

Project description

classlogging

Class-based logging facility.

Installation

pip install classlogging

Usage example

import classlogging


class MyClass(classlogging.LoggerMixin):
    def test_log_value(self, value: str) -> None:
        self.logger.debug(f"Got value: {value}")


if __name__ == "__main__":
    classlogging.configure_logging(level=classlogging.LogLevel.DEBUG)
    MyClass().test_log_value("Foo")
    # Writes to stderr:
    # 2022-01-01 12:34:56,789 DEBUG [__main__.MyClass] Got value: Foo

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

classlogging-1.1.1.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

classlogging-1.1.1-py3-none-any.whl (8.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