-
Notifications
You must be signed in to change notification settings - Fork 80
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
Adding logLevel documentation #3089
base: develop
Are you sure you want to change the base?
Conversation
appendLogLevel( { "logLevel >= 1", "Infos about RelpermDriver" } ); | ||
appendLogLevel( { "logLevel >= 1", "Indicate if the internal results are consistent" } ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have expect either this syntax:
appendLogLevel( { "logLevel >= 1", "Infos about RelpermDriver" },
{ "logLevel >= 1", "Indicate if the internal results are consistent" } );
Or this one
appendLogLevel( "logLevel >= 1", "Infos about RelpermDriver" );
appendLogLevel( "logLevel >= 1", "Indicate if the internal results are consistent" );
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second one is more convenient
try | ||
{ | ||
WrapperBase & wrapper = getWrapperBase( logLevelName ); | ||
appendLogLevelToWrapper( wrapper, log ); | ||
}catch( std::domain_error const & ) | ||
{ | ||
WrapperBase & wrapper = registerWrapper( logLevelName, &m_logLevel ); | ||
enableLogLevelInput(); | ||
appendLogLevelToWrapper( wrapper, log ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this project, try-catch is for adding more info to errors, not to recover from an erroneous state.
Use a if-else syntax.
* @brief Append a log level/description to the description of the wrapped object | ||
* @param log An entry (log level/ log Description) to append | ||
*/ | ||
void appendLogLevel( std::pair< const std::string, const std::string > log ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appendLogLevelDescription( string_view loggingCondition, string_view caseDescription )
?
/// Map for building the log level string for each wrapper | ||
/// key : logLevel, values : description(s) for a level | ||
std::map< std::string, std::vector< std::string > > m_logLevelsDescriptions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one logLevel
per Group
= only one map per Group
Every wrapper should not have logLevel
functionnalities, Group
should.
Those method & attributes you added in Wrapper
are not at the right place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking comments
Currently, we have this output in all
Group
documentation files:I.e.
SolidMechanics_LagrangianFEM.rsts.rst
:.rst` :This PR aims to add more context to the different logLevels of GEOS :
I.e.
SolidMechanics_LagrangianFEM.rsts.rst
: