Hide debug logging using keyword filtering

Also, adds a hint to the "KeywordsForLogging" preference to inform users about the 'enable-all' option.
This commit is contained in:
Magne Sjaastad committed 2025-07-25 08:42:13 +02:00
1 parent b9f13f742d
commit fdcd157238
4 files changed
+10 -8

No files matched your search

@@ -858,7 +858,7 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct
bool isLoggingEnabled = RiaPreferencesSystem::current()->isLoggingActivatedForKeyword( "RiaApplication" );
if ( isLoggingEnabled )
{
RiaLogging::logElapsedTime( QString( "Project file '%1' loaded" ).arg( projectFileName ), startTime );
RiaLogging::logElapsedTime( QString( "Opened project file '%1' " ).arg( projectFileName ), startTime );
}
return true;
@@ -96,7 +96,10 @@ RiaPreferencesSystem::RiaPreferencesSystem()
EclipseTextFileReaderModeType( RiaPreferencesSystem::EclipseTextFileReaderMode::FILE ),
"Eclipse Text File Import mode (GRDECL)" );
CAF_PDM_InitField( &m_keywordsForLogging, "KeywordsForLogging", QString(), "Keywords to enable debug logging, separated by semicolon" );
CAF_PDM_InitField( &m_keywordsForLogging,
"KeywordsForLogging",
QString(),
"Keywords to enable debug logging, separated by semicolon.\nType 'enable-all' to enable logging for all objects." );
}
//--------------------------------------------------------------------------------------------------
@@ -176,8 +176,6 @@ bool RifOpmSummaryTools::isEsmryConversionRequired( const QString& fileName )
auto candidateEsmryFileName = enhancedSummaryFilename( fileName );
auto smspecFileName = smspecSummaryFilename( fileName );
RiaLogging::debug( "RifOpmSummaryTools::isEsmryConversionRequired" );
if ( !QFile::exists( candidateEsmryFileName ) && QFile::exists( smspecFileName ) )
{
return true;
@@ -549,7 +549,6 @@ void RimSummaryCaseMainCollection::loadFileSummaryCaseData( const std::vector<Ri
{
caf::ProgressInfo progInfo( fileSummaryCases.size(), "Loading Summary Cases" );
RiaLogging::info( "Loading Summary Cases" );
RifOpmCommonEclipseSummary::resetEnhancedSummaryFileCount();
RiaThreadSafeLogger threadSafeLogger;
@@ -582,11 +581,13 @@ void RimSummaryCaseMainCollection::loadFileSummaryCaseData( const std::vector<Ri
auto startTime = RiaLogging::currentTime();
addCaseRealizationParametersIfFound( *fileSummaryCase, fileSummaryCase->summaryHeaderFilename(), parameterFilePath );
bool isLoggingEnabled = RiaPreferencesSystem::current()->isLoggingActivatedForKeyword( "OpmSummaryImport" );
if ( isLoggingEnabled ) RiaLogging::logElapsedTime( "Setting of realization parameters", startTime );
if ( isLoggingEnabled )
{
RiaLogging::logElapsedTime( "Setting of realization parameters", startTime );
RiaLogging::info( QString( "Completed %1" ).arg( fileSummaryCase->summaryHeaderFilename() ) );
}
}
RiaLogging::info( QString( "Completed %1" ).arg( fileSummaryCase->summaryHeaderFilename() ) );
progInfo.setProgress( cIdx );
}
for ( const auto& txt : threadSafeLogger.messages() )