Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional logging levels using a sub-classed logger #26

Open
DaveStrickland opened this issue Nov 27, 2024 · 0 comments
Open

Add additional logging levels using a sub-classed logger #26

DaveStrickland opened this issue Nov 27, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@DaveStrickland
Copy link
Owner

The standard python logger comes with the following named log levels: NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL. In practice this limits logging of nominal processing to two levels: DEBUG and INFO, with occasional WARNING messages.

This flattened hierarchy results in large numbers of logged events having the same level and obscures the processing flow when operating on large numbers of files. The Boost logging library has a addition level below DEBUG called TRACE which is useful for tracing program execution at a lower level than DEBUG.

Sub-class the python logging class in AstroPhotography.core.logger to add new named levels:

  • TRACE at a level below DEBUG
  • OVERVIEW at a level above INFO but below WARNING

The new logging class should support named member function calls of the form logger.trace(msg: str) and logger.overview(msg: str)

@DaveStrickland DaveStrickland added the enhancement New feature or request label Nov 27, 2024
@DaveStrickland DaveStrickland self-assigned this Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant