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 details)
Built Distribution
File details
Details for the file log_decor-2.0.5.tar.gz
.
File metadata
- Download URL: log_decor-2.0.5.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f50f82ac75942830874050fded5142528aa5e76fdc1bd2c6f5bf2c54d947bd0d |
|
MD5 | b49fe88ef6f15177b65bfcb0c843c57c |
|
BLAKE2b-256 | 202039c40a4239df260659469a061505ee51e91cdca3e3874b84a96b138157b4 |
File details
Details for the file log_decor-2.0.5-py3-none-any.whl
.
File metadata
- Download URL: log_decor-2.0.5-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.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab044764469e960fca6b4ac235f7790e9227a7f90c9fb711f048677587177266 |
|
MD5 | ebba4d8d7aa2d928ebc725c434d384c3 |
|
BLAKE2b-256 | 87d9239e26c53c52f5c61ec8c8a874ea196c65e5d404c388a0bd3b88824985e7 |