Logging macros & Log Level refactor
Open
@MelReyCG is already working on this.
Since Feb 29, 2024.
- Dominant language
- C++
- Stars
- 287
- Forks
- 109
- Avg merge
- 4d 41m
- Merged PRs (30d)
- 5
Description
To base the work of the #2277 EPIC, we need to :
- Refactor logging macros and the logger namespace so we have - at least under the hood - a real class,
- the messages should be all equally aligned with the outputting rank (see below),
- Refactor the
LogLevel, it should be anenumwith clear and documented labels (see below),
Refactored log output exemple :
INFO : well ‘my well (myxml.xml:123)’ is shut
RANK 170
===================================================
TIMESTEP : Time: 0s, dt:864s, Cycle: 0
RANK 0
===================================================
WARNING : Time-step required will be increased based on state change.
RANK 1
LogLevel enum proposal :
/// @brief Enumerate the logging levels from the most importants messages to the one that contain the more details.
enum class LogLevel : int16_t
{
Silent = -1, // Useful as a globalLogLevel for silencing the logger. shouldn't be used as a message level.
Important = 0, // Application level messages (help, almost blocking warnings, application informations & phases)
Progress = 1, // Time step attempts, newton loop progress of Solver objects
Detailed = 2, // More detailed info and stats that affect progress, e.g. residual norms.
Trace = 3, // This is intended as a user-level debugging tool. detailed info trace what each component is
// doing. e.g. a line for every part of the assembly process, every boundary condition that's being
// applied by a physics solver, etc.
Debug = 4, // Information that are only relevant for a developper in a debugging context.
DebugTrace = 5, // This level is useful to have deeper debugging information (which can be potencially heavy to log).
};
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.