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