Refactor logging of elapsed time

This commit is contained in:
Magne Sjaastad
2025-07-23 15:23:08 +02:00
parent 3727a12634
commit f9f9b6b07b
7 changed files with 29 additions and 44 deletions
@@ -467,12 +467,7 @@ QString RiaApplication::createAbsolutePathFromProjectRelativePath( QString proje
//--------------------------------------------------------------------------------------------------
bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAction loadAction, RiaProjectModifier* projectModifier )
{
bool showDebugTiming = false;
if ( showDebugTiming )
{
QString timingText = "RiaApplication::loadProject";
RiaLogging::resetTimer( timingText );
}
auto startTime = RiaLogging::currentTime();
// First Close the current project
@@ -860,9 +855,10 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct
RiaLogging::info( QString( "Completed open of project file : '%1'" ).arg( projectFileName ) );
}
if ( showDebugTiming )
bool isLoggingEnabled = RiaPreferencesSystem::current()->isLoggingActivatedForKeyword( "RiaApplication" );
if ( isLoggingEnabled )
{
RiaLogging::logTimeElapsed( "" );
RiaLogging::logElapsedTime( QString( "Project file '%1' loaded" ).arg( projectFileName ), startTime );
}
return true;