From 8fd67cf12a584835e74c1f7a292c30c793e843e1 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 9 Aug 2013 22:40:12 +0200 Subject: First attempt at Linux console colors Ref.: issue #41 --- source/MCLogger.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'source/MCLogger.h') diff --git a/source/MCLogger.h b/source/MCLogger.h index 0c4566400..158ccc6b6 100644 --- a/source/MCLogger.h +++ b/source/MCLogger.h @@ -26,11 +26,20 @@ public: // tolua_export static cMCLogger* GetInstance(); private: - void SetColor( unsigned char a_Color ); - + enum eColorScheme + { + csGrayOnBlack, + csYellowOnBlack, + csRedOnBlack, + csBlackOnRed, + } ; + + /// Sets the specified color scheme in the terminal (TODO: if coloring available) + void SetColor(eColorScheme a_Scheme); + cCriticalSection m_CriticalSection; - cLog* m_Log; - static cMCLogger* s_MCLogger; + cLog * m_Log; + static cMCLogger * s_MCLogger; }; // tolua_export extern void LOG(const char* a_Format, ...); -- cgit v1.2.3 From 63b2fa21e8c7891da5f232e79f41b845d17c6e3d Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 10 Aug 2013 12:44:39 +0200 Subject: Disabled coloring for redirected output. --- source/MCLogger.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source/MCLogger.h') diff --git a/source/MCLogger.h b/source/MCLogger.h index 158ccc6b6..6f7d34e66 100644 --- a/source/MCLogger.h +++ b/source/MCLogger.h @@ -28,15 +28,18 @@ public: // tolua_export private: enum eColorScheme { - csGrayOnBlack, - csYellowOnBlack, - csRedOnBlack, - csBlackOnRed, + csRegular, + csInfo, + csWarning, + csError, } ; /// Sets the specified color scheme in the terminal (TODO: if coloring available) void SetColor(eColorScheme a_Scheme); + /// Resets the color back to whatever is the default in the terminal + void ResetColor(void); + cCriticalSection m_CriticalSection; cLog * m_Log; static cMCLogger * s_MCLogger; -- cgit v1.2.3