do not write any logs in disk when LogToDisk=0

This commit is contained in:
Sergio Perez Fernandez
2025-05-29 16:04:54 +02:00
committed by teejusb
parent b3c43c9dea
commit 2517959050
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -90,7 +90,7 @@ m_bUserLogToDisk(false), m_bFlush(false), m_bShowLogOutput(false)
g_fileUserLog = new RageFile;
g_fileTimeLog = new RageFile;
if(!g_fileTimeLog->Open(TIME_PATH, RageFile::WRITE|RageFile::STREAMED))
if(m_bLogToDisk && !g_fileTimeLog->Open(TIME_PATH, RageFile::WRITE|RageFile::STREAMED))
{ fprintf(stderr, "Couldn't open %s: %s\n", TIME_PATH, g_fileTimeLog->GetError().c_str()); }
g_Mutex = new RageMutex( "Log" );
@@ -294,7 +294,7 @@ void RageLog::Write( int where, const RString &sLine )
* and stdout. */
sStr.insert( 0, sTimestamp );
if(where & WRITE_TO_TIME)
if( m_bLogToDisk && (where & WRITE_TO_TIME))
g_fileTimeLog->PutLine(sStr);
AddToRecentLogs( sStr );
+2 -2
View File
@@ -799,8 +799,8 @@ static void ApplyLogPreferences()
{
LOG->SetShowLogOutput( PREFSMAN->m_bShowLogOutput );
LOG->SetLogToDisk( PREFSMAN->m_bLogToDisk );
LOG->SetInfoToDisk( true );
LOG->SetUserLogToDisk( true );
LOG->SetInfoToDisk( PREFSMAN->m_bLogToDisk );
LOG->SetUserLogToDisk( PREFSMAN->m_bLogToDisk );
LOG->SetFlushing( PREFSMAN->m_bForceLogFlush );
Checkpoints::LogCheckpoints( PREFSMAN->m_bLogCheckpoints );
}