Skip to content

Set logger in struphy __init__.py#219

Draft
spossann wants to merge 4 commits intouse-logging-instead-of-printfrom
use-logging-instead-of-print-stefan
Draft

Set logger in struphy __init__.py#219
spossann wants to merge 4 commits intouse-logging-instead-of-printfrom
use-logging-instead-of-print-stefan

Conversation

@spossann
Copy link
Copy Markdown
Member

@spossann spossann commented Apr 2, 2026

This PR goes into use-logging-instead-of-print, see #199

I read that the logger should be set up at the beginning of the entry point of the program. Since we do not have a clear entry point, the best thing is to maybe setup in the struphy __init__.py.

  • move logger setup to struphy __init__.py
  • do not use .json file to avoid importing struphy for the path
  • use function set_logger_level to set the level of all handlers

The function set_logger_level can be tested with python src/struphy/utils/utils.py.

I set the default level to logging.WARNING.

@spossann spossann requested a review from max-models April 2, 2026 09:57
@spossann spossann mentioned this pull request Apr 2, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant