How to implement level based logging in golang?

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

    Some more suggestions, now that the existing answers are quite old:

    • https://github.com/op/go-logging - smaller than the other here
    • https://github.com/sirupsen/logrus - used in many popular projects such as Docker
    • https://github.com/inconshreveable/log15
    • https://github.com/golang/glog - from Google, implementation of their C++ glog library in Go
    • https://github.com/go-kit/kit/tree/master/log focused on "structured logging" which is better for tools to consume
    • https://github.com/uber-go/zap - "blazing fast"

提交回复
热议问题