From 6927aa1544508d8b223845e25e6f848db2a3f5a7 Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Wed, 3 May 2017 01:17:00 +0300 Subject: [PATCH] Update android_sink.h --- include/spdlog/sinks/android_sink.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/spdlog/sinks/android_sink.h b/include/spdlog/sinks/android_sink.h index afc7a547..26431829 100644 --- a/include/spdlog/sinks/android_sink.h +++ b/include/spdlog/sinks/android_sink.h @@ -16,7 +16,7 @@ #include #if !defined(SPDLOG_ANDROID_LOG_NUM_OF_RETRIES) -define SPDLOG_ANDROID_LOG_NUM_OF_RETRIES 2 +#define SPDLOG_ANDROID_RETRIES 2 #endif namespace spdlog @@ -40,8 +40,8 @@ public: // See system/core/liblog/logger_write.c for explanation of return value int ret = __android_log_write(priority, _tag.c_str(), msg_output); - int retry_count = 1; - while ((ret == -11/*EAGAIN*/) && (retry_count < SPDLOG_ANDROID_LOG_NUM_OF_RETRIES)) + int retry_count = 0; + while ((ret == -11/*EAGAIN*/) && (retry_count < SPDLOG_ANDROID_RETRIES)) { std::this_thread::sleep_for(std::chrono::milliseconds(5)); ret = __android_log_write(priority, _tag.c_str(), msg_output);