How to implement level based logging in golang?

前端 未结 11 1910
谎友^
谎友^ 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:23

    I am working with rlog at the moment and like their approach. The code looks good, simplistic and sufficiently documented.

    What convinced me:

    • no external dependencies
    • i can use rlog.Info() anywhere without passing around references
    • good usage of environment variables
    • arbitrary number of trace levels e.g. rlog.Trace(4, "foo")

提交回复
热议问题