Metadata-Version: 2.1
Name: fasthep_logging
Version: 0.1.1
Summary: Enhanced logging for the FAST-HEP toolkit
Author-email: Luke Kreczko <kreczko@cern.ch>
Maintainer-email: The FAST-HEP admins <fast-hep@cern.ch>
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Classifier: License :: OSI Approved :: BSD License
Classifier: Topic :: Scientific/Engineering
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Development Status :: 1 - Planning
Requires-Dist: typing_extensions >=3.7; python_version<'3.8'
Requires-Dist: rich >=10.12.0
Requires-Dist: pytest >=6 ; extra == "dev"
Requires-Dist: Sphinx>=4.0 ; extra == "docs"
Requires-Dist: myst_parser>=0.13 ; extra == "docs"
Requires-Dist: sphinx-book-theme>=0.1.0 ; extra == "docs"
Requires-Dist: sphinx_copybutton ; extra == "docs"
Requires-Dist: pytest >=6 ; extra == "test"
Project-URL: homepage, https://github.com/FAST-HEP/fasthep-logging
Provides-Extra: dev
Provides-Extra: docs
Provides-Extra: test

# fasthep-logging

[![Actions Status][actions-badge]][actions-link]
[![Documentation Status][rtd-badge]][rtd-link]

[![PyPI version][pypi-version]][pypi-link]
[![PyPI platforms][pypi-platforms]][pypi-link]

[![GitHub Discussion][github-discussions-badge]][github-discussions-link]
[![Gitter][gitter-badge]][gitter-link]

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

```python
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)
```

<!-- prettier-ignore-start -->
[actions-badge]:            https://github.com/FAST-HEP/fasthep-logging/workflows/CI/badge.svg
[actions-link]:             https://github.com/FAST-HEP/fasthep-logging/actions
[github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
[github-discussions-link]:  https://github.com/orgs/FAST-HEP/discussions
[gitter-badge]:             https://badges.gitter.im/FAST-HEP/community.svg
[gitter-link]:              https://gitter.im/FAST-HEP/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
[pypi-link]:                https://pypi.org/project/fasthep-logging/
[pypi-platforms]:           https://img.shields.io/pypi/pyversions/fasthep-logging
[pypi-version]:             https://badge.fury.io/py/fasthep-logging.svg
[rtd-badge]:                https://readthedocs.org/projects/fasthep-logging/badge/?version=latest
[rtd-link]:                 https://fasthep-logging.readthedocs.io/en/latest/?badge=latest
[sk-badge]:                 https://scikit-hep.org/assets/images/Scikit--HEP-Project-blue.svg
<!-- prettier-ignore-end -->

