From 39452b60a1f72b76f908609b97a1bdcd69e3559f Mon Sep 17 00:00:00 2001 From: liuyifei Date: Sat, 6 Jul 2024 08:24:47 +0000 Subject: [PATCH] buffer size convert: LOG_ONLY_PRERELEASE to LOG_CORE Signed-off-by: liuyifei --- services/hilogd/log_buffer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/hilogd/log_buffer.cpp b/services/hilogd/log_buffer.cpp index 32e33b1..7056aff 100644 --- a/services/hilogd/log_buffer.cpp +++ b/services/hilogd/log_buffer.cpp @@ -104,7 +104,7 @@ size_t HilogBuffer::Insert(const HilogMsg& msg, bool& isFull) static const float DROP_RATIO = 0.05; while (sizeByType[bufferType] > g_maxBufferSizeByType[bufferType] * (1 - DROP_RATIO) && it != hilogDataList.end()) { - if ((*it).type != bufferType) { // Only remove old logs of the same type + if (ConvertBufType((*it).type) != bufferType) { // Only remove old logs of the same type ++it; continue; } @@ -116,7 +116,7 @@ size_t HilogBuffer::Insert(const HilogMsg& msg, bool& isFull) OnDeleteItem(it, DeleteReason::BUFF_OVERFLOW); size_t cLen = it->len - it->tagLen; - sizeByType[(*it).type] -= cLen; + sizeByType[ConvertBufType((*it).type)] -= cLen; it = hilogDataList.erase(it); } -- Gitee