#14446 Initialize loggers before reading cloud config files

Cloud services are configured from RiaApplication::initialize(), which runs before the subclasses append their logger instances. All messages from the cloud config file search were therefore dropped. Add a virtual initializeLoggers() called before the cloud configuration is read, and move creation of the file logger and the std out logger into the overrides. The message panel logger depends on the main windows, and is still created in RiaGuiApplication::initialize().

Do not write fields with IO disabled to the application store, mirroring the check already present when reading. This stops the cloud service configuration from being persisted into the user preferences file.
This commit is contained in:
Magne Sjaastad committed 2026-08-04 13:05:03 +02:00
1 parent 1aa95936fc
commit 5efcf88949
7 files changed
+39 -12

No files matched your search

@@ -551,16 +551,23 @@ void RiaGuiApplication::initialize()
RiaLogging::appendLoggerInstance( std::move( logger ) );
}
{
auto logFolder = QDir::homePath() + "/.resinsight/logs";
auto fileLogger = std::make_unique<RiaFileLogger>( logFolder.toStdString() );
fileLogger->setLevel( int( RiaLogging::logLevelBasedOnPreferences() ) );
RiaLogging::appendLoggerInstance( std::move( fileLogger ) );
}
m_socketServer = new RiaSocketServer( this );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaGuiApplication::initializeLoggers()
{
// The message panel logger requires the main windows, and is created in initialize(). The file logger has no
// such dependency, and is created here to capture messages from the early startup sequence.
auto logFolder = QDir::homePath() + "/.resinsight/logs";
auto fileLogger = std::make_unique<RiaFileLogger>( logFolder.toStdString() );
fileLogger->setLevel( int( RiaLogging::logLevelBasedOnPreferences() ) );
RiaLogging::appendLoggerInstance( std::move( fileLogger ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------