Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contextual_logger-0.0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

contextual_logger-0.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file contextual_logger-0.0.1.tar.gz.

File metadata

  • Download URL: contextual_logger-0.0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0

File hashes

Hashes for contextual_logger-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f97f62d29e9ee30c79d7f3b45d2aff8ff9e3b2c661b9fc9c62bd01b395489681
MD5 9518a5ef0e1f683c73fe744d77cfa8a8
BLAKE2b-256 f254036bf8222e2d0e59175689087bf22e6619d8dcd426d0a82c1e8177cbc9e7

See more details on using hashes here.

File details

Details for the file contextual_logger-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for contextual_logger-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c74d255df1b7da61d888d27ab1aa6e94318b36ea0f38a085b6ee291777ccb8d2
MD5 a6b9467eb588cd5cff15c2cf1569954b
BLAKE2b-256 f5094967cbd22a5345dbec279cedd3fa3bff61a445ad25e149c2e177a274ae6d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page