-
Notifications
You must be signed in to change notification settings - Fork 90
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
feat: Adding log parts #3019
base: develop
Are you sure you want to change the base?
feat: Adding log parts #3019
Conversation
…dudes/table-layout
…feature/dudes/table-layout" This reverts commit 8f74cfa.
…nto feature/dudes/table-layout
void begin( std::ostream & os = std::cout ); | ||
|
||
/** | ||
* @brief Draw the last part of the section. It include the title |
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.
* @brief Draw the last part of the section. It include the title | |
* @brief Draw the last part of the section. It include the title and optionnaly, the end description(s). |
* @brief Set the minimal width of a row | ||
* @param minWidth The minimal width of the table | ||
*/ | ||
void setMinWidth( integer const & minWidth ); |
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.
a good feature in the future would be to have a setMaxWidth()
with line wrapping, to ensure that a section cannot be too large.
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 could do this in another PR
Can you share a full log generated after this PR? |
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.
just check what happened with schema/docs changes
clear(); | ||
} | ||
|
||
void LogPart::end( std::ostream & os ) |
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.
Please restore the "End of: " output, don't forget to take the full size of the end into account for sizing the width.
string_view spaces = std::string( maxNameSize - name.size(), ' ' ); | ||
string_view nameFormatted = GEOS_FMT( "{}{} ", name, spaces ); | ||
|
||
m_formattedDescriptions.push_back( GEOS_FMT( "{}{}", nameFormatted, m_descriptionValues[idxName][0] )); |
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 think it would less mask what you want to do.
string_view spaces = std::string( maxNameSize - name.size(), ' ' ); | |
string_view nameFormatted = GEOS_FMT( "{}{} ", name, spaces ); | |
m_formattedDescriptions.push_back( GEOS_FMT( "{}{}", nameFormatted, m_descriptionValues[idxName][0] )); | |
string_view spaces = std::string( maxNameSize - name.size(), ' ' ); | |
string_view nameFormatted = GEOS_FMT( "{}{}", name, spaces ); | |
m_formattedDescriptions.push_back( GEOS_FMT( "{} {}", nameFormatted, m_descriptionValues[idxName][0] )); |
* @brief Add a description to the logPart by concatening a description name and descriptions values. | ||
* @param name The description name | ||
* @param args Descriptions values to be concatened. | ||
* Descriptions values can be be any types and will be aligned |
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.
* Descriptions values can be be any types and will be aligned | |
* @note Descriptions values can be be any formatted types. Values will be aligned altogether. |
"\n######################################################################\n" | ||
"## TIMESTEP START ##\n" | ||
"######################################################################\n" | ||
"## - Time : 00h08m20s out of 2d, 21h26m40s (0% completed) ##\n" | ||
"## 500 s / 250000 s ##\n" | ||
"## - Delta Time : 00h16m40s (1000 s) ##\n" | ||
"## Description test ##\n\n" |
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.
shouldn't we have the following?
"\n######################################################################\n" | |
"## TIMESTEP START ##\n" | |
"######################################################################\n" | |
"## - Time : 00h08m20s out of 2d, 21h26m40s (0% completed) ##\n" | |
"## 500 s / 250000 s ##\n" | |
"## - Delta Time : 00h16m40s (1000 s) ##\n" | |
"## Description test ##\n\n" | |
"\n####################################################################\n" | |
"## TIMESTEP START ##\n" | |
"####################################################################\n" | |
"## - Time : 00h08m20s out of 2d, 21h26m40s (0% completed) ##\n" | |
"## 500 s / 250000 s ##\n" | |
"## - Delta Time : 00h16m40s (1000 s) ##\n" | |
"## Description test ##\n\n" |
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.
because min width is set to 70
/// Vector containing formatted description | ||
std::vector< string > m_formattedDescriptions; | ||
/// Name of the description, formatted to be : [Name] : [Values1]\n[Values2] | ||
std::vector< string > m_descriptionNames; | ||
/// Values in the descrpption the description | ||
std::vector< std::vector< string > > m_descriptionValues; | ||
|
||
/// title of logPart | ||
string m_logPartTitle; | ||
/// Title footer string | ||
string m_footerTitle; | ||
/// min width of logPart length | ||
size_t m_rowMinWidth = 70; | ||
/// logPart length | ||
size_t m_logPartWidth; |
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.
/// Vector containing formatted description | |
std::vector< string > m_formattedDescriptions; | |
/// Name of the description, formatted to be : [Name] : [Values1]\n[Values2] | |
std::vector< string > m_descriptionNames; | |
/// Values in the descrpption the description | |
std::vector< std::vector< string > > m_descriptionValues; | |
/// title of logPart | |
string m_logPartTitle; | |
/// Title footer string | |
string m_footerTitle; | |
/// min width of logPart length | |
size_t m_rowMinWidth = 70; | |
/// logPart length | |
size_t m_logPartWidth; | |
struct Description { | |
/// Title footer string | |
string m_title; | |
/// Name of the description, formatted to be : [Name] : [Values1]\n[Values2] | |
std::vector< string > m_descriptionNames; | |
/// Values in the descrpption the description | |
std::vector< std::vector< string > > m_descriptionValues; | |
/// Vector containing the descriptions formatted by formatDescriptions() | |
std::vector< string > m_formattedDescriptionLines; | |
/// logPart length | |
size_t m_logPartWidth; | |
void formatDescriptions(); | |
}; | |
/// min width of logPart length | |
size_t m_rowMinWidth = 70; | |
Description startDesc; | |
Description endDesc; |
And so, you should be able to easily restore the addEndDescription()
methods, which should be more user friendly from my point of view.
I'm not sure that void formatDescriptions();
should be relocated here (and that its signature is complete), but if the code is well structured, it should be possible.
This PR aim to improve the readibility of the logs by adding log separation the differents parts of the log and
the first step for displaying specific log or timestep we want.
The log separation identified are
ProblemManager::postInputInitializationRecursive()
;ProblemManager::generateMesh()
;ProblemManager::applyNumericalMethods()
;ProblemManager::egisterDataOnMeshRecursive()
;ProblemManager::initialize()
;EventManager::run()
basicCleanup()
Example of an input :