From b0248cff8467b6c54fac44c9227f697b8af863d4 Mon Sep 17 00:00:00 2001 From: qintl Date: Thu, 3 Jan 2019 15:33:24 +0800 Subject: [PATCH] elog_hexdump add lvl and tag filter Signed-off-by: qintl --- easylogger/src/elog.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/easylogger/src/elog.c b/easylogger/src/elog.c index 75fcdec..93125dc 100644 --- a/easylogger/src/elog.c +++ b/easylogger/src/elog.c @@ -689,6 +689,14 @@ void elog_hexdump(const char *name, uint8_t width, uint8_t *buf, uint16_t size) return; } + /* level filter */ + if (ELOG_LVL_DEBUG > elog.filter.level) { + return; + } else if (!strstr(name, elog.filter.tag)) { /* tag filter */ + //TODO 可以考虑采用KMP及朴素模式匹配字符串,提升性能 + return; + } + /* lock output */ elog_output_lock();