Contextual Logger
Project description
Contextual Logger
Usage
import logging
import contextual_logger
logger = logging.getLogger("name")
def process_example(ex):
logger.info("Processing example by doing ...")
return ex
data = ...
with logger(dataset="SST2"):
data = [process_example(d) for d in data]
{
"level_name": "INFO",
"timestamp": "...",
"logger": "demo",
"message": "Processing example by doing ...",
"dataset": "SST2"
}
{
"level_name": "INFO",
"timestamp": "...",
"logger": "demo",
"message": "Processing example by doing ...",
"dataset": "SST2"
}
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
Built Distribution
File details
Details for the file contextual-logger-0.0.2.tar.gz
.
File metadata
- Download URL: contextual-logger-0.0.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6114dfa8868f0fa738dcc0fbffb7a3549517c03387dfaf9c11cb9e95bd2a13c1 |
|
MD5 | abb6b63b08c3519934d75934e6798800 |
|
BLAKE2b-256 | b4cbeb1ea004ec66eba4fb3cc716b17e6783a7fa5abee9b5d6a24cd2e45e6201 |
File details
Details for the file contextual_logger-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: contextual_logger-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15acffe36b4d5a96a8f9955270016b367dc4217b28adead47df967be7c1ab2fb |
|
MD5 | 0de34e2991dc5b3040d43b08d7d58a03 |
|
BLAKE2b-256 | e2a66d2542a61dfe3b9bab62b5ae9c1a31d542dee3244bbd89febe90b4842f22 |