From 25179590508fbfdd05827f74be2d7a05d002e002 Mon Sep 17 00:00:00 2001 From: Sergio Perez Fernandez Date: Thu, 29 May 2025 16:04:54 +0200 Subject: [PATCH] do not write any logs in disk when LogToDisk=0 --- src/RageLog.cpp | 4 ++-- src/StepMania.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/RageLog.cpp b/src/RageLog.cpp index 53b9a24054..8887314c86 100644 --- a/src/RageLog.cpp +++ b/src/RageLog.cpp @@ -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 ); diff --git a/src/StepMania.cpp b/src/StepMania.cpp index 269bffb64f..405bfb548f 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -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 ); }