From a2e3a1ea8c18b62d76ef0e2a438f256e50b541a1 Mon Sep 17 00:00:00 2001 From: Nomango Date: Sun, 17 May 2020 20:15:58 +0800 Subject: [PATCH] Add KGE_LOG_STREAM & KGE_ERROR_STREAM --- src/kiwano/core/Logger.cpp | 2 +- src/kiwano/core/Logger.h | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/kiwano/core/Logger.cpp b/src/kiwano/core/Logger.cpp index 3b958817..25400f0a 100644 --- a/src/kiwano/core/Logger.cpp +++ b/src/kiwano/core/Logger.cpp @@ -298,7 +298,7 @@ void Logger::ResetStreamToStdStream() } // replace the C++ global locale with the user-preferred locale - (void)std::locale::global(std::locale("")); + (void)std::locale::global(std::locale()); (void)std::cout.imbue(std::locale()); (void)std::cerr.imbue(std::locale()); diff --git a/src/kiwano/core/Logger.h b/src/kiwano/core/Logger.h index 8f24fe34..b4177507 100644 --- a/src/kiwano/core/Logger.h +++ b/src/kiwano/core/Logger.h @@ -19,10 +19,9 @@ // THE SOFTWARE. #pragma once -#include #include -#include -#include +#include +#include #ifndef KGE_SYS_LOG #ifdef KGE_DEBUG @@ -49,6 +48,14 @@ #define KGE_LOGF(FORMAT, ...) ::kiwano::Logger::GetInstance().Printf(::kiwano::Logger::Level::Info, FORMAT, __VA_ARGS__) #endif +#ifndef KGE_LOG_STREAM +#define KGE_LOG_STREAM() ::kiwano::Logger::GetInstance().GetOutputStream() +#endif + +#ifndef KGE_ERROR_STREAM +#define KGE_ERROR_STREAM() ::kiwano::Logger::GetInstance().GetErrorStream() +#endif + namespace kiwano { /**