xcompact3d / x3d2

https://xcompact3d.github.io/x3d2
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

Design a global logging system for better error reporting #30

Open JamieJQuinn opened 7 months ago

JamieJQuinn commented 7 months ago

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:

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

Tasks:

slaizet commented 7 months ago

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

pbartholomew08 commented 7 months ago

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.