Skip to main content

Logging decorators for functions and methods.

Project description

Introduction

This package contains decorators that provide logging functionality for functions and methods.

Example

import logging

from log_decor import add_logger, log_msg


@add_logger()
class Example:

    @log_msg('message', level=logging.DEBUG)
    def f1(self):
        pass

    @log_msg(level=logging.INFO)
    def f2(self):
        pass
>>> logging.basicConfig(level=logging.DEBUG)
>>> example = Example()
>>> example.f1()
DEBUG:Example:message
>>> example.f2()
INFO:Example:f2()

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

log_decor-2.0.5.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

log_decor-2.0.5-py3-none-any.whl (5.7 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