Core/Logging: Minor changes

- Select stderr when writing ERROR and FATAL messages
- Simplify function defines
- Fix `logs` table structure with latest logging changes
This commit is contained in:
Spp
2013-11-11 14:34:44 +01:00
parent 79a2d6b7fc
commit cd48662233
10 changed files with 59 additions and 118 deletions

View File

@@ -59,7 +59,7 @@ void AppenderConsole::InitColors(std::string const& str)
void AppenderConsole::SetColor(bool stdout_stream, ColorTypes color)
{
#if PLATFORM == PLATFORM_WINDOWS
#if PLATFORM == PLATFORM_WINDOWS
static WORD WinColorFG[MaxColors] =
{
0, // BLACK
@@ -87,7 +87,7 @@ void AppenderConsole::SetColor(bool stdout_stream, ColorTypes color)
HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE);
SetConsoleTextAttribute(hConsole, WinColorFG[color]);
#else
#else
enum ANSITextAttr
{
TA_NORMAL = 0,
@@ -156,7 +156,7 @@ void AppenderConsole::ResetColor(bool stdout_stream)
void AppenderConsole::_write(LogMessage const& message)
{
bool stdout_stream = message.level == LOG_LEVEL_ERROR || message.level == LOG_LEVEL_FATAL;
bool stdout_stream = !(message.level == LOG_LEVEL_ERROR || message.level == LOG_LEVEL_FATAL);
if (_colored)
{