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.4.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

log_decor-2.0.4-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file log_decor-2.0.4.tar.gz.

File metadata

  • Download URL: log_decor-2.0.4.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for log_decor-2.0.4.tar.gz
Algorithm Hash digest
SHA256 9ac184f8fc756437d643875e9210fb4c4e55965f6c3e8789b408482d1c5b933f
MD5 a0bf1b9dee16c09ef1bd7f81feb7e6d7
BLAKE2b-256 6ea3b71ecd9b35e1febd1a41caecaf9003f91b8c695066c525e1ab301837fccc

See more details on using hashes here.

File details

Details for the file log_decor-2.0.4-py3-none-any.whl.

File metadata

  • Download URL: log_decor-2.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for log_decor-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 04c202b752c745d5d101123b7de7e66766d6591482147a4228ece0d91e0748ff
MD5 676143c93c3d13aeeec3eae4cde74a4e
BLAKE2b-256 18331b3045993ce0b516e233cebf77133ae1a45ba52fcdc8e0db8d73a014c74b

See more details on using hashes here.

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