Log all calls to a module
Project description
Log all calls to a module
Dependencies
structlog
Features
Log all calls to a module
Example
>>> from logmod import logmod
>>> import secrets
>>> logmod(secrets)
>>>
>>> secret.token_hex(5)
logmod: call to secret.token_hex with (5,) {}
'd34eb399f8'
Results in:
2018-01-09 01:04.15 coolname -> secrets.token_hex at example.py:8 args=(5,) caller=coolname callsite={'filename': 'example.py', 'lineno': 8} func=token_hex kwargs={} mod=secrets
2018-01-09 01:04.15 token_hex -> secrets.token_bytes at /usr/lib/python3.6/secrets.py:58 args=(5,) caller=token_hex callsite={'filename': '/usr/lib/python3.6/secrets.py', 'lineno': 58} func=token_bytes kwargs={} mod=secrets
Hello, f717fd2370
2018-01-09 01:04.15 <module> -> random at example.py:12 args=() caller=<module> callsite={'filename': 'example.py', 'lineno': 12} func=random kwargs={} mod=None
0.46899158604445124
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
logmod-0.1.tar.gz
(2.0 kB
view details)
File details
Details for the file logmod-0.1.tar.gz
.
File metadata
- Download URL: logmod-0.1.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ee75bbf91da20b1b98f2c602fb3dff64594969c3bcb8ba6da9f16951e0b78b8 |
|
MD5 | a6d7c1dff6453f12db6722ef7d91ba44 |
|
BLAKE2b-256 | 9a384cc48177647fbc682e1662b940422df5d308cec0dac489ce74c9e7b6945a |