How to implement level based logging in golang?

前端 未结 11 2205
谎友^
谎友^ 2020-12-24 04:44

Is there any good wrapper available for level based logging in golang? If not, how should I go about implementing one myself?

What I want is pretty simple. I want a

11条回答
  •  佛祖请我去吃肉
    2020-12-24 05:16

    I have added logging level support to the built-in Go log package. You can find my code here:

    https://github.com/gologme/log

    In addition to adding support for Info, Warn, and Debug, users can also define their own arbitrary logging levels. Logging levels are enabled and disabled individually. This means you can turn on Debug logs without also getting everything else.

提交回复
热议问题