ezpylogger: Log easier and simpler
Project description
ezpylogger: Logging made simpler
What is this?
This is an easy to use, logging library that can log function calls of ANY functions!
This includes functions that you've made, functions that have been predefined. (Like any functions/methods that are included in other libraries)
How do you use this?
Simple, just import the ezpylogger module and use the Logger to log function calls.
Example:
from ezpylogger import Logger
from time import sleep
@Logger()
def add(a, b):
return a + b
class Mul:
logger = Logger()
def __init__(self):
pass
@logger
def __call__(self, *args, **kwargs):
numbers = [ arg if arg.__class__.__name__ == 'int' or arg.__class__.__name__ == 'float' else 1 for arg in args ]
rv = [1]
for number in numbers:
rv[0] *= number
# Some very heavy computational task
self.logger(sleep)(30)
return rv + numbers
seven = add(3, 4)
prod = Mul()(1, 2, 3, 4, 5, 6, 7, 0.08, 0.69, 4.20)
Installation
python3 -m pip install ezpylogger
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ezpylogger-0.1.3.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for ezpylogger-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c540c863a14521d32383835896411e5151b849376a84e15790b7594da442c60 |
|
MD5 | edfdd49f78717899f0897a405e86865c |
|
BLAKE2b-256 | 0f758f6b475db8c07e8bcf36688a21949b92de9d95b4336204e8ca1c5934eb2b |