Giter VIP home page Giter VIP logo

Comments (9)

armink avatar armink commented on August 26, 2024 1

你有测试过吗?NULL == 是不是多余了?记得更新下 API 文档,别的问题就没了哈

from easylogger.

armink avatar armink commented on August 26, 2024

一般常见的是过滤完后,保留想要的日志,你这个正好相反。

或者改下逻辑,当设定的过滤 TAG 的首字母是 ! 时,自动过滤不含该 TAG 的日志

from easylogger.

MRkuan avatar MRkuan commented on August 26, 2024

一般常见的是过滤完后,保留想要的日志,你这个正好相反。

或者改下逻辑,当设定的过滤 TAG 的首字母是 ! 时,自动过滤不含该 TAG 的日志

这样?

    if (elog.filter.tag[0] == '!')
    {
        if (NULL == strstr(tag, &(elog.filter.tag[1]))     /* tag filter */
        {
            //TODO 可以考虑采用KMP及朴素模式匹配字符串,提升性能
            return;
        }
    else if (!strstr(tag, elog.filter.tag))     /* tag filter */
    {
        //TODO 可以考虑采用KMP及朴素模式匹配字符串,提升性能
        return;
    }

可以合并到主线中?

from easylogger.

MRkuan avatar MRkuan commented on August 26, 2024

你有测试过吗?NULL == 是不是多余了?记得更新下 API 文档,别的问题就没了哈

好,晚上回家测试提交下PR

我想了下,现有的接口是过滤一个TAG,如果多个呢?是否可以搞个过滤tag群组,目前项目上使用elog 有这个需求,再把反过滤 ! 用起来,丰富过滤

岂不美哉?(王朗大笑)

from easylogger.

armink avatar armink commented on August 26, 2024

一般是设定某个 tag 的日志,在输出时限定其 level ,当然这个 level 可以设定为最高级,也就是这个 tag 的日志也就不会输出内容了

from easylogger.

MRkuan avatar MRkuan commented on August 26, 2024

一般是设定某个 tag 的日志,在输出时限定其 level ,当然这个 level 可以设定为最高级,也就是这个 tag 的日志也就不会输出内容了

那个level 是全局的level, 没办法 动态的 调整某个模块TAG 的level

我看了下现有的接口,没办法 动态 的调整 某个模块TAG 的level,只能静态通过宏编译去控制
其实如果可以做到这个,也就没有必要我提出今天issue了

from easylogger.

armink avatar armink commented on August 26, 2024

每个 tag 一个动态 level 挺好实现的,想搞吗,我可以协助你完成这个功能哈

from easylogger.

MRkuan avatar MRkuan commented on August 26, 2024

每个 tag 一个动态 level 挺好实现的,想搞吗,我可以协助你完成这个功能哈

大佬,给个机会,我来提交这个PR,可以吹牛逼,参与过开源项目了

from easylogger.

armink avatar armink commented on August 26, 2024

fixed in #60

from easylogger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.