Skip to main content

Enhanced logging for the FAST-HEP toolkit

Project description

fasthep-logging

Actions Status Documentation Status

PyPI version PyPI platforms

GitHub Discussion Gitter

The FAST-HEP logging package adds two new log levels to the standard Python logging:

  • TRACE is the most verbose level, and is used for debugging purposes.
  • TIMING is used to log timing information. Log level is between DEBUG and WARNING.

In addition, this package sets a logging standard for FAST-HEP projects:

  • per-log-level formatting
  • log file support

Example

from fasthep_logging import get_logger, TRACE

log = get_logger("FASTHEP::Carpenter")
log.setLevel(TRACE)

...

log.debug("This is a debug message %s", msg)
log.trace("This is a verbosity level higher than DEBUG")


from codetiming import Timer

with Timer(
    text=f"Processing data took {{:.3f}}s for {file_path}",
    logger=log.timing,  # type: ignore[attr-defined]
):
    process_data(file_path)

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

fasthep_logging-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

fasthep_logging-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file fasthep_logging-0.1.0.tar.gz.

File metadata

  • Download URL: fasthep_logging-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for fasthep_logging-0.1.0.tar.gz
Algorithm Hash digest
SHA256 48a0f018826ab6e80b24a2308a69bd58c1b0e7b888aaca361d328da283818a7d
MD5 4bb912f5af3f382f72e9c614b9779a3e
BLAKE2b-256 8ec61de765147d19e6f2c8f3ec67fcc3074f0253571a4f82943024789424aa2b

See more details on using hashes here.

File details

Details for the file fasthep_logging-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fasthep_logging-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81c75b27a109273113c0d6cee262bc1276924f1cd3bca4ad907de7e49d3f05d6
MD5 516bc995c1ff23081e5a3dd1dce7552c
BLAKE2b-256 7bc0f9e2fa6138e2afd2d69d465e69df1683f4e88682a09b89a274f4dd98fc13

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