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-2024.6.1.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

fasthep_logging-2024.6.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fasthep_logging-2024.6.1.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for fasthep_logging-2024.6.1.tar.gz
Algorithm Hash digest
SHA256 ebeaccf4cb1d2226e329a20da53b8213e18d3b418cc2df1ca4d2544ac79d96d9
MD5 6ca9f829804d0aa22603ef628e7dcc6d
BLAKE2b-256 a88d0262db38d19a47043d60efcda2bf3edf7f59cafec44697b1d703f57fc31f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fasthep_logging-2024.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8795bb913126c8ab3916dbbc83affdfc9929043f0916202956d0a3b0ca5c42c0
MD5 bfd13b844ef860001631eb984f9713ef
BLAKE2b-256 21ae4ac8ef71f9db546fd046f473e379ddee8237404160518415c6cf173939ea

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