From 330dd1d6477f05312750173ada375fcae13b7306 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Fri, 29 Nov 2024 21:56:12 +0900 Subject: [PATCH] LOG: def + include fixes --- es-core/src/Log.cpp | 12 ++++++++---- es-core/src/Log.h | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/es-core/src/Log.cpp b/es-core/src/Log.cpp index 8f5643674..a4a72a0cc 100644 --- a/es-core/src/Log.cpp +++ b/es-core/src/Log.cpp @@ -11,6 +11,10 @@ #include "Settings.h" #include "utils/StringUtil.h" +#if defined(RETRODECK) +#include +#endif + LogLevel Log::getReportingLevel() { std::unique_lock lock {sLogMutex}; @@ -25,7 +29,7 @@ void Log::setReportingLevel(LogLevel level) void Log::init() { -#if defined(RetroDECK) +#if defined(RETRODECK) // Check for the rd_logs_folder environment variable const char* logFolder = std::getenv("rd_logs_folder"); if (logFolder && std::strlen(logFolder) > 0) @@ -86,7 +90,7 @@ std::ostringstream& Log::get(LogLevel level) #endif std::unique_lock lock {sLogMutex}; -#if defined(RetroDECK) +#if defined(RETRODECK) // Convert log level to uppercase for RetroDECK std::string levelUpper = mLogLevelMap[level]; std::transform(levelUpper.begin(), levelUpper.end(), levelUpper.begin(), ::toupper); @@ -149,14 +153,14 @@ Log::~Log() std::cerr << mOutStringStream.str(); #endif -#if defined(RetroDECK) +#if defined(RETRODECK) // Always write logs to the terminal as well when RetroDECK is defined std::cout << mOutStringStream.str(); #endif } // RetroDECK specific function -#if defined(RetroDECK) +#if defined(RETRODECK) void Log::setReportingLevelFromEnv() { // Check for the logging_level environment variable diff --git a/es-core/src/Log.h b/es-core/src/Log.h index 586afe9bb..8c63b3122 100644 --- a/es-core/src/Log.h +++ b/es-core/src/Log.h @@ -53,6 +53,10 @@ public: static void flush(); static void close(); + #if defined(RETRODECK) + static void setReportingLevelFromEnv(); + #endif + protected: std::ostringstream mOutStringStream;