reduce RageLog prefsman use
This commit is contained in:
@@ -86,6 +86,7 @@ enum {
|
||||
RageLog::RageLog()
|
||||
{
|
||||
m_bEnabled = true;
|
||||
m_bFlush = false;
|
||||
|
||||
// delete old log files
|
||||
remove( LOG_PATH );
|
||||
@@ -140,6 +141,11 @@ void RageLog::SetLogging( bool b )
|
||||
m_bEnabled = b;
|
||||
}
|
||||
|
||||
void RageLog::SetFlushing( bool b )
|
||||
{
|
||||
m_bFlush = b;
|
||||
}
|
||||
|
||||
void RageLog::ShowConsole()
|
||||
{
|
||||
#if defined(WIN32) && !defined(_XBOX)
|
||||
@@ -230,7 +236,7 @@ void RageLog::Write( int where, CString str)
|
||||
|
||||
printf("%s\n", str.c_str() );
|
||||
|
||||
if( (PREFSMAN && PREFSMAN->m_bForceLogFlush) || (where & WRITE_TO_INFO) )
|
||||
if( m_bFlush || (where & WRITE_TO_INFO) )
|
||||
Flush();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,9 +35,11 @@ public:
|
||||
static const char *GetRecentLog( int n );
|
||||
|
||||
void SetLogging( bool b ); // enable or disable logging
|
||||
void SetFlushing( bool b ); // enable or disable flushing
|
||||
|
||||
private:
|
||||
bool m_bEnabled;
|
||||
bool m_bFlush;
|
||||
FILE *m_fileLog, *m_fileInfo;
|
||||
void Write( int, CString );
|
||||
void UpdateMappedLog();
|
||||
|
||||
@@ -636,6 +636,7 @@ int main(int argc, char* argv[])
|
||||
HOOKS->DumpDebugInfo();
|
||||
|
||||
LOG->SetLogging( PREFSMAN->m_bLogging );
|
||||
LOG->SetFlushing( PREFSMAN->m_bForceLogFlush );
|
||||
|
||||
CheckSettings();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user