AGBV / YASF

Yet Another Scattering Framework python implementation
https://agbv.github.io/YASF/
MIT License
0 stars 0 forks source link

Improve logging throughout the package #51

Open arunoruto opened 5 months ago

arunoruto commented 5 months ago

Currently, YASF's logs are mixed with those of other packages. A filtering system should be applied to separate the logs and, therefore, enable a cleaner log output for YASF.

Such an option is possible with loguru library.

arunoruto commented 5 months ago

The logging has been improved with 05e2cac05581bee03518e65aab84d0c7547f4ffa

To print the logs, following lines are needed:

import logging
logger = logging.getLogger("yasfpy")
sh = logging.StreamHandler()
sh.setFormatter(logging.Formatter('[%(asctime)s] %(name)-18s %(levelname)-7s: %(message)s'))
logger.addHandler(sh)
logger.setLevel(logging.INFO)