log-indented gives you humani-friendly logs.
Project description
log-indented
This is a package for producing indented, easy to understand logs.
Example:
Executing count_barnyard_animinals() in this code example:
from log_indented import logged, log_info
@logged(logger)
def count_chicken() -> int:
return 3
@logged(logger)
def count_ducks() -> int:
return 7
@logged(logger)
def count_birds() -> int:
return count_chicken() + count_ducks()
@logged(logger)
def count_goats() -> int:
return 7
@logged(logger)
def count_sheep() -> int:
return 0
@logged(logger)
def count_barnyard_animinals() -> int:
return count_birds() + count_goats() + count_sheep()
will produce output similar to this:
+ count_barnyard_animinals: enter
+ count_birds: enter
+ count_chicken: enter
- count_chicken: exit. took 500.9 ms.
+ count_ducks: enter
- count_ducks: exit. took 501.0 ms.
- count_birds: exit. took 501.0 ms.
+ count_goats: enter
- count_goats: exit. took 501.0 ms.
+ count_sheep: enter
- count_sheep: exit. took 501.1 ms.
- count_barnyard_animinals: exit. took 501.1 ms.
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
log_indented-0.3.1.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for log_indented-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38c5517b08f51361f6572f233759c38a7cb2c28b204083ce1c93683e3d2a40e6 |
|
MD5 | 0e5ea7b57b502b208f1a98f5fdaeb835 |
|
BLAKE2b-256 | 8ce97186d7ad5e5eedf3b679c5ffb3e4159e221c62cdc7390b9b62b0869da8c7 |