From dfe20e116b0e136f079b2da74d987467e3c04c02 Mon Sep 17 00:00:00 2001 From: XMRig Date: Fri, 4 May 2018 01:01:05 +0700 Subject: [PATCH] Fix color issues. --- src/common/log/Log.h | 20 ++++++++++---------- src/workers/Workers.cpp | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/common/log/Log.h b/src/common/log/Log.h index 463c2248d..31600dc68 100644 --- a/src/common/log/Log.h +++ b/src/common/log/Log.h @@ -80,16 +80,16 @@ private: }; -#define RED_BOLD(x) "\e[1;31m" x "\e[0m" -#define RED(x) "\e[0;31m" x "\e[0m" -#define GREEN_BOLD(x) "\e[1;32m" x "\e[0m" -#define GREEN(x) "\e[0;32m" x "\e[0m" -#define MAGENTA_BOLD(x) "\e[1;35m" x "\e[0m" -#define MAGENTA(x) "\e[0;35m" x "\e[0m" -#define CYAN_BOLD(x) "\e[1;36m" x "\e[0m" -#define CYAN(x) "\e[0;36m" x "\e[0m" -#define WHITE_BOLD(x) "\e[1;37m" x "\e[0m" -#define WHITE(x) "\e[0;37m" x "\e[0m" +#define RED_BOLD(x) "\x1B[1;31m" x "\x1B[0m" +#define RED(x) "\x1B[0;31m" x "\x1B[0m" +#define GREEN_BOLD(x) "\x1B[1;32m" x "\x1B[0m" +#define GREEN(x) "\x1B[0;32m" x "\x1B[0m" +#define MAGENTA_BOLD(x) "\x1B[1;35m" x "\x1B[0m" +#define MAGENTA(x) "\x1B[0;35m" x "\x1B[0m" +#define CYAN_BOLD(x) "\x1B[1;36m" x "\x1B[0m" +#define CYAN(x) "\x1B[0;36m" x "\x1B[0m" +#define WHITE_BOLD(x) "\x1B[1;37m" x "\x1B[0m" +#define WHITE(x) "\x1B[0;37m" x "\x1B[0m" #define LOG_ERR(x, ...) Log::i()->message(Log::ERR, x, ##__VA_ARGS__) diff --git a/src/workers/Workers.cpp b/src/workers/Workers.cpp index 497e30606..8991966ec 100644 --- a/src/workers/Workers.cpp +++ b/src/workers/Workers.cpp @@ -301,9 +301,9 @@ void Workers::start(IWorker *worker) const size_t memory = m_status.ways * xmrig::cn_select_memory(m_status.algo) / 1048576; if (m_status.colors) { - LOG_INFO(GREEN_BOLD("READY (CPU)") " threads " CYAN_BOLD("%zu(%zu)") " huge pages %s%zu/%zu %1.0f%%\e[0m memory " CYAN_BOLD("%zu.0 MB") "", + LOG_INFO(GREEN_BOLD("READY (CPU)") " threads " CYAN_BOLD("%zu(%zu)") " huge pages %s%zu/%zu %1.0f%%\x1B[0m memory " CYAN_BOLD("%zu.0 MB") "", m_status.threads, m_status.ways, - (m_status.hugePages == m_status.pages ? "\e[1;32m" : (m_status.hugePages == 0 ? "\e[1;31m" : "\e[1;33m")), + (m_status.hugePages == m_status.pages ? "\x1B[1;32m" : (m_status.hugePages == 0 ? "\x1B[1;31m" : "\x1B[1;33m")), m_status.hugePages, m_status.pages, percent, memory); } else {