Skip to content

Commit

Permalink
log repeate check not ignore thread name fix https://github.com/ZLMed…
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongguangjie committed Feb 2, 2024
1 parent 8a7dc16 commit 72296af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Util/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static int64_t timevalDiff(struct timeval &a, struct timeval &b) {
}

void Logger::writeChannels(const LogContextPtr &ctx) {
if (ctx->_line == _last_log->_line && ctx->_file == _last_log->_file && ctx->str() == _last_log->str()) {
if (ctx->_line == _last_log->_line && ctx->_file == _last_log->_file && ctx->str() == _last_log->str() && ctx->_thread_name == _last_log->_thread_name) {
//重复的日志每隔500ms打印一次,过滤频繁的重复日志
++_last_log->_repeat;
if (timevalDiff(_last_log->_tv, ctx->_tv) > 500) {
Expand Down

0 comments on commit 72296af

Please sign in to comment.