mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user