parent
4996e53bf5
commit
a985949cfe
@ -317,6 +317,7 @@ cFileListener::cFileListener(void)
|
|||||||
void cFileListener::Log(AString a_Message, cLogger::eLogLevel a_LogLevel)
|
void cFileListener::Log(AString a_Message, cLogger::eLogLevel a_LogLevel)
|
||||||
{
|
{
|
||||||
const char * LogLevelPrefix = "Unkn ";
|
const char * LogLevelPrefix = "Unkn ";
|
||||||
|
bool ShouldFlush = false;
|
||||||
switch (a_LogLevel)
|
switch (a_LogLevel)
|
||||||
{
|
{
|
||||||
case cLogger::llRegular:
|
case cLogger::llRegular:
|
||||||
@ -332,15 +333,21 @@ void cFileListener::Log(AString a_Message, cLogger::eLogLevel a_LogLevel)
|
|||||||
case cLogger::llWarning:
|
case cLogger::llWarning:
|
||||||
{
|
{
|
||||||
LogLevelPrefix = "Warn ";
|
LogLevelPrefix = "Warn ";
|
||||||
|
ShouldFlush = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case cLogger::llError:
|
case cLogger::llError:
|
||||||
{
|
{
|
||||||
LogLevelPrefix = "Err ";
|
LogLevelPrefix = "Err ";
|
||||||
|
ShouldFlush = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_File.Printf("%s%s", LogLevelPrefix, a_Message.c_str());
|
m_File.Printf("%s%s", LogLevelPrefix, a_Message.c_str());
|
||||||
|
if (ShouldFlush)
|
||||||
|
{
|
||||||
|
m_File.Flush();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user