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)
Built Distribution
Close
Hashes for log_decor-2.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab044764469e960fca6b4ac235f7790e9227a7f90c9fb711f048677587177266 |
|
MD5 | ebba4d8d7aa2d928ebc725c434d384c3 |
|
BLAKE2b-256 | 87d9239e26c53c52f5c61ec8c8a874ea196c65e5d404c388a0bd3b88824985e7 |