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

Design a global logging system for better error reporting #30

Open
4 tasks
JamieJQuinn opened this issue Feb 6, 2024 · 2 comments
Open
4 tasks

Design a global logging system for better error reporting #30

JamieJQuinn opened this issue Feb 6, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request maintainability priority medium Medium priority issue

Comments

@JamieJQuinn
Copy link
Collaborator

JamieJQuinn commented Feb 6, 2024

Currently errors are reported throughout the codebase with regular print statements:

print *, "Error: something happened"

While this is generally fine, a more sophisticated system that looks something like...

logger.warn("This is just a warning")
> WARNING: This is just a warning

logger.error("This is a catastrophic error")
> ERROR: This is a catastrophic error

logger.info("Just reporting regular information")
> INFO: Just reporting regular information

would allow some nice benefits:

  • flexible, global redirection of different types of errors to files & other output streams
  • uniform hierarchy of messages (e.g. error, warn, info, debug, etc)

Mainly just adding this issue to discuss whether we want this & what it could look like.

Tasks:

  • Integrate fypp into build system
  • Write logger
  • Migrate all existing print statements to logger
  • Catch future uses of print with some static analysis
@slaizet
Copy link
Contributor

slaizet commented Feb 6, 2024

yes please for this! You will know better than me what's best to do!

@pbartholomew08
Copy link
Member

Something to maybe consider is whether to print regardless of rank or only on root, or atleast having the option to do so. Though this might run the risk of deadlocks, maybe a case only for the info class of messages.

@JamieJQuinn JamieJQuinn self-assigned this Feb 12, 2024
@JamieJQuinn JamieJQuinn changed the title Should there be a global logging system for better error reporting? Design a global logging system for better error reporting? Feb 12, 2024
@JamieJQuinn JamieJQuinn changed the title Design a global logging system for better error reporting? Design a global logging system for better error reporting Feb 12, 2024
@Nanoseb Nanoseb added enhancement New feature or request maintainability labels Feb 16, 2024
@JamieJQuinn JamieJQuinn added the priority medium Medium priority issue label Feb 26, 2024
@Nanoseb Nanoseb mentioned this issue Mar 6, 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 maintainability priority medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

4 participants