Skip to content

Commit

Permalink
chore: Rounding out logging
Browse files Browse the repository at this point in the history
Did some
[reading](https://loguru.readthedocs.io/en/stable/resources/recipes.html#configuring-loguru-to-be-used-by-a-library-or-an-application)
and I was wrong to suggest setting up `loguru` in `__init__.py` so happy to use
`topofileforamts/logging.py`. Implemented the one recommendation in the above linked section. No tests for logging but
logs _are_ output.
  • Loading branch information
ns-rse committed Apr 26, 2024
1 parent 9b2f76f commit e1b1392
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ dmypy.json
# Pyre type checker
.pyre/

# Package version
_version.py

# VSCode
.vscode/

Expand Down
7 changes: 6 additions & 1 deletion topofileformats/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
"""topofileformats."""
"""A module for loading AFM files of different formats."""


from loguru import logger

logger.disable(__package__)
2 changes: 2 additions & 0 deletions topofileformats/asd.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
skip_bytes,
)

logger.enable(__package__)


# pylint: disable=too-few-public-methods
class VoltageLevelConverter:
Expand Down

0 comments on commit e1b1392

Please sign in to comment.