mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
neato line coloring (time in white, rest colored)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2702 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -15,6 +15,7 @@
|
|||||||
// Official SVN repository and contact information can be found at
|
// Official SVN repository and contact information can be found at
|
||||||
// http://code.google.com/p/dolphin-emu/
|
// http://code.google.com/p/dolphin-emu/
|
||||||
|
|
||||||
|
#include <algorithm> // min
|
||||||
#include <string> // System: To be able to add strings with "+"
|
#include <string> // System: To be able to add strings with "+"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -89,6 +90,10 @@ void ConsoleListener::Log(LogTypes::LOG_LEVELS level, const char *text)
|
|||||||
|
|
||||||
switch (level)
|
switch (level)
|
||||||
{
|
{
|
||||||
|
case NOTICE_LEVEL: // light green
|
||||||
|
color = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
|
||||||
|
break;
|
||||||
|
|
||||||
case ERROR_LEVEL: // light red
|
case ERROR_LEVEL: // light red
|
||||||
color = FOREGROUND_RED | FOREGROUND_INTENSITY;
|
color = FOREGROUND_RED | FOREGROUND_INTENSITY;
|
||||||
break;
|
break;
|
||||||
@ -97,24 +102,25 @@ void ConsoleListener::Log(LogTypes::LOG_LEVELS level, const char *text)
|
|||||||
color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
|
color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NOTICE_LEVEL: // light green
|
|
||||||
color = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case INFO_LEVEL: // cyan
|
case INFO_LEVEL: // cyan
|
||||||
color = FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY;
|
color = FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEBUG_LEVEL: // light gray
|
case DEBUG_LEVEL: // gray
|
||||||
color = FOREGROUND_INTENSITY;
|
color = FOREGROUND_INTENSITY;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: // white
|
default: // off-white
|
||||||
color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY;
|
color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (strlen(text) > 10) {
|
||||||
|
// first 10 chars white
|
||||||
|
SetConsoleTextAttribute(m_hStdOut, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
|
||||||
|
WriteConsole(m_hStdOut, text, 10, &cCharsWritten, NULL);
|
||||||
|
text += 10;
|
||||||
|
}
|
||||||
SetConsoleTextAttribute(m_hStdOut, color);
|
SetConsoleTextAttribute(m_hStdOut, color);
|
||||||
|
|
||||||
WriteConsole(m_hStdOut, text, (DWORD)strlen(text), &cCharsWritten, NULL);
|
WriteConsole(m_hStdOut, text, (DWORD)strlen(text), &cCharsWritten, NULL);
|
||||||
#else
|
#else
|
||||||
fprintf(stderr, "%s", text);
|
fprintf(stderr, "%s", text);
|
||||||
|
Reference in New Issue
Block a user