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.2.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for log_decor-2.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0939a8d6a2424c18525c2c362343fc432fa437b7f5b2e96197e56520b7c377a9 |
|
MD5 | 216417bca35ff2666930f16be7e8dc5b |
|
BLAKE2b-256 | 541a8be0bccb26924028fb9e0fd1f828dca8854ec486819d8aa67c04aec65513 |