Reduce the buffer size again in Release to the default value (#1043)

This commit is contained in:
Howard Wu 2021-09-03 22:09:25 +08:00 committed by GitHub
parent c2cdecf644
commit 00e40aac28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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<char, ANDROID_LOG_SILENT + 1> 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{};