diff --git a/core/src/main/cpp/daemon/logcat.cpp b/core/src/main/cpp/daemon/logcat.cpp index e590f4fd..9cfe0749 100644 --- a/core/src/main/cpp/daemon/logcat.cpp +++ b/core/src/main/cpp/daemon/logcat.cpp @@ -12,6 +12,12 @@ using namespace std::string_view_literals; constexpr size_t kMaxLogSize = 4 * 1024 * 1024; +#ifndef NDEBUG + constexpr size_t kLogBufferSize = 1 * 1024 * 1024; +#else + constexpr size_t kLogBufferSize = 256 * 1024; +#endif + constexpr std::array kLogChar = { /*ANDROID_LOG_UNKNOWN*/'?', /*ANDROID_LOG_DEFAULT*/ '?', @@ -158,7 +164,7 @@ void Logcat::Run() { for (log_id id:{LOG_ID_MAIN, LOG_ID_CRASH}) { auto *logger = android_logger_open(logger_list.get(), id); if (logger == nullptr) continue; - android_logger_set_log_size(logger, kMaxLogSize); + android_logger_set_log_size(logger, kLogBufferSize); } struct log_msg msg{};