Logger: Fixed windows debug ODS logger, fixed-size file prefixes.
This commit is contained in:
parent
08c55ef983
commit
5921f78e52
@ -17,6 +17,7 @@
|
|||||||
class cColouredConsoleListener
|
class cColouredConsoleListener
|
||||||
: public cLogger::cListener
|
: public cLogger::cListener
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
virtual void SetLogColour(cLogger::eLogLevel a_LogLevel) = 0;
|
virtual void SetLogColour(cLogger::eLogLevel a_LogLevel) = 0;
|
||||||
virtual void SetDefaultLogColour() = 0;
|
virtual void SetDefaultLogColour() = 0;
|
||||||
@ -24,7 +25,7 @@
|
|||||||
virtual void Log(AString a_Message, cLogger::eLogLevel a_LogLevel) override
|
virtual void Log(AString a_Message, cLogger::eLogLevel a_LogLevel) override
|
||||||
{
|
{
|
||||||
SetLogColour(a_LogLevel);
|
SetLogColour(a_LogLevel);
|
||||||
puts(a_Message.c_str());
|
fputs(a_Message.c_str(), stdout);
|
||||||
SetDefaultLogColour();
|
SetDefaultLogColour();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -46,7 +47,7 @@
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef _DEBUG
|
||||||
virtual void Log(AString a_Message, cLogger::eLogLevel a_LogLevel) override
|
virtual void Log(AString a_Message, cLogger::eLogLevel a_LogLevel) override
|
||||||
{
|
{
|
||||||
super::Log(a_Message, a_LogLevel);
|
super::Log(a_Message, a_LogLevel);
|
||||||
@ -289,31 +290,31 @@ cFileListener::cFileListener(void)
|
|||||||
|
|
||||||
void cFileListener::Log(AString a_Message, cLogger::eLogLevel a_LogLevel)
|
void cFileListener::Log(AString a_Message, cLogger::eLogLevel a_LogLevel)
|
||||||
{
|
{
|
||||||
AString LogLevelString;
|
const char * LogLevelPrefix = "U ";
|
||||||
switch (a_LogLevel)
|
switch (a_LogLevel)
|
||||||
{
|
{
|
||||||
case cLogger::llRegular:
|
case cLogger::llRegular:
|
||||||
{
|
{
|
||||||
LogLevelString = "Log";
|
LogLevelPrefix = " ";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case cLogger::llInfo:
|
case cLogger::llInfo:
|
||||||
{
|
{
|
||||||
LogLevelString = "Info";
|
LogLevelPrefix = "i ";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case cLogger::llWarning:
|
case cLogger::llWarning:
|
||||||
{
|
{
|
||||||
LogLevelString = "Warning";
|
LogLevelPrefix = "W ";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case cLogger::llError:
|
case cLogger::llError:
|
||||||
{
|
{
|
||||||
LogLevelString = "Error";
|
LogLevelPrefix = "E ";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_File.Printf("%s: %s", LogLevelString.c_str(), a_Message.c_str());
|
m_File.Printf("%s: %s", LogLevelPrefix, a_Message.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user