Auto generate logs for functions
Project description
python-autologs
Auto generate logs for functions based on function docstring
Decorator to generate log info and log error for function. The log contain the first line from the function docstring and resolve names from function docstring by function args, any args that not resolved from the docstring will be printed after. In some cases only info or error log is needed, the decorator can be called with @generate_logs(error=False) to get only log INFO and vice versa
Example: @generate_logs() def my_test(test, cases): ''' Run test with cases ''' return
my_test(test='my-test-name', cases=['case01', 'case02'] Will generate: INFO Run test my-test-name with cases case01, case02 ERROR Failed to Run test my-test-name with cases case01, case02 if step is True: Test Step 1: Run test my-test-name with cases case01, case02
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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size python_autologs-0.0.5-py3-none-any.whl (6.4 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size python-autologs-0.0.5.tar.gz (4.5 kB) | File type Source | Python version None | Upload date | Hashes View |
Hashes for python_autologs-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 118277ea760e54030ac034f6fb456925d0be782b854e3ba94fbdc124e52a81a5 |
|
MD5 | e1d13b7b092f52636809b1113ed19581 |
|
BLAKE2-256 | 333605e531e8d5258676d9527eb9e7b31120acfa04aea4e04d6ab430a7c3f03c |