Add verbosity level to platform log for better integration with Web and Android platforms

This commit is contained in:
Wojtek Figat
2026-02-24 20:09:09 +01:00
parent 195d5b1aa2
commit e41ec4ebfd
14 changed files with 32 additions and 20 deletions

View File

@@ -149,9 +149,7 @@ void WebPlatform::GetUTCTime(int32& year, int32& month, int32& dayOfWeek, int32&
millisecond = (int64)(emscripten_get_now() - DateStart) % 1000; // Fake it based on other timer
}
#if !BUILD_RELEASE
void WebPlatform::Log(const StringView& msg)
void WebPlatform::Log(const StringView& msg, int32 logType)
{
const StringAsANSI<512> msgAnsi(*msg, msg.Length());
@@ -163,9 +161,16 @@ void WebPlatform::Log(const StringView& msg)
buffer[i] = 'p';
}
emscripten_log(EM_LOG_CONSOLE, buffer);
int flags = EM_LOG_CONSOLE;
if (logType == (int32)LogType::Warning)
flags |= EM_LOG_WARN;
if (logType == (int32)LogType::Error)
flags |= EM_LOG_ERROR;
emscripten_log(flags, buffer);
}
#if !BUILD_RELEASE
bool WebPlatform::IsDebuggerPresent()
{
return false;