From 1b6352b775bb0c4341b3247c1cf88fdca88e4cb6 Mon Sep 17 00:00:00 2001 From: Attila Uygun Date: Sat, 12 Aug 2023 22:57:54 +0200 Subject: [PATCH] fix --- build/android/app/CMakeLists.txt | 2 ++ src/base/log.cc | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/build/android/app/CMakeLists.txt b/build/android/app/CMakeLists.txt index 94345ef..472f2b4 100644 --- a/build/android/app/CMakeLists.txt +++ b/build/android/app/CMakeLists.txt @@ -134,9 +134,11 @@ add_library(kaliber SHARED ../../../src/third_party/glslang/SPIRV/SPVRemapper.cpp ../../../src/third_party/glslang/SPIRV/SpvTools.cpp ../../../src/third_party/jsoncpp/jsoncpp.cpp + ../../../src/third_party/minimp3/minimp3.cc ../../../src/third_party/minizip/ioapi.c ../../../src/third_party/minizip/unzip.c ../../../src/third_party/spirv-reflect/spirv_reflect.c + ../../../src/third_party/stb/stb_image.cc ../../../src/third_party/texture_compressor/dxt_encoder_internals.cc ../../../src/third_party/texture_compressor/dxt_encoder.cc ../../../src/third_party/texture_compressor/texture_compressor_etc1.cc diff --git a/src/base/log.cc b/src/base/log.cc index cc690da..a937429 100644 --- a/src/base/log.cc +++ b/src/base/log.cc @@ -4,11 +4,11 @@ #include #elif defined(_WIN32) #include +#include #else -#include +#include #endif #include -#include #include namespace base { @@ -38,14 +38,17 @@ LogMessage::~LogMessage() { size_t last_slash_pos = filename.find_last_of("\\/"); if (last_slash_pos != std::string::npos) filename = filename.substr(last_slash_pos + 1); - std::string log_str = std::format("{} [{}:{}] {}", verbosity_level_, - filename.c_str(), line_, message.c_str()); #if defined(__ANDROID__) - __android_log_print(ANDROID_LOG_ERROR, "kaliber", "%s", log_str.c_str()); + __android_log_print(ANDROID_LOG_ERROR, "kaliber", "%d [%s:%d] %s", + verbosity_level_, filename.c_str(), line_, + message.c_str()); #elif defined(_WIN32) - OutputDebugStringA(log_str.c_str()); + OutputDebugStringA( + std::format("{} [{}:{}] {}", verbosity_level_, filename, line_, message) + .c_str()); #else - std::clog << log_str; + printf("%d [%s:%d] %s", verbosity_level_, filename.c_str(), line_, + message.c_str()); #endif }