mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-22 08:35:39 +00:00
When RetroDECK is defined the logs are written in the RetroDECK format
This commit is contained in:
parent
c562a217fc
commit
032ed656f4
|
@ -71,9 +71,20 @@ std::ostringstream& Log::get(LogLevel level)
|
|||
localtime_r(&t, &tm);
|
||||
#endif
|
||||
std::unique_lock<std::mutex> lock {sLogMutex};
|
||||
|
||||
#if defined(RetroDECK)
|
||||
// Convert log level to uppercase for RetroDECK
|
||||
std::string levelUpper = mLogLevelMap[level];
|
||||
std::transform(levelUpper.begin(), levelUpper.end(), levelUpper.begin(), ::toupper);
|
||||
|
||||
mOutStringStream << "[" << std::put_time(&tm, "%Y-%m-%d %H:%M:%S")
|
||||
<< "] [" << levelUpper << "] [ES-DE] ";
|
||||
#else
|
||||
mOutStringStream << std::put_time(&tm, "%b %d %H:%M:%S ") << mLogLevelMap[level]
|
||||
<< (level == LogLevel::LogInfo || level == LogLevel::LogWarning ? ": " :
|
||||
": ");
|
||||
#endif
|
||||
|
||||
mMessageLevel = level;
|
||||
|
||||
return mOutStringStream;
|
||||
|
|
Loading…
Reference in a new issue