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.1.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

fasthep_logging-0.1.1-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

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