Skip to content

fix: Ensure synchronous tag filtering for log level configuration#177

Open
hengyizhao wants to merge 1 commit into
armink:masterfrom
hengyizhao:fix/elog_set_filter_tag_lvl
Open

fix: Ensure synchronous tag filtering for log level configuration#177
hengyizhao wants to merge 1 commit into
armink:masterfrom
hengyizhao:fix/elog_set_filter_tag_lvl

Conversation

@hengyizhao

Copy link
Copy Markdown

使用elog_set_filter_tag_lvl(const char *tag, uint8_t level)设置相应tag和日志等级时,应同步对elog.filter.tag进行设置,否则在elog_output中会因为tag过滤通不过,而导致无法输出

void elog_output(uint8_t level, const char *tag, const char *file, const char *func,
        const long line, const char *format, ...) {
    // 无关代码
    /* level filter */
    if (level > elog.filter.level || level > elog_get_filter_tag_lvl(tag)) {
        return;
    } else if (!strstr(tag, elog.filter.tag)) { /* tag filter */
        return;
    }
    // 无关代码
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant