高性能日志库
goos: darwin
goarch: amd64
pkg: github.com/imkira/go-loggers-bench
cpu: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
BenchmarkLogsTextPositive-4 100000000 320.9 ns/op 40 B/op 2 allocs/op
BenchmarkLogsTextNegative-4 1000000000 9.407 ns/op 0 B/op 0 allocs/op
BenchmarkLogsJSONNegative-4 1000000000 11.42 ns/op 0 B/op 0 allocs/op
BenchmarkLogsJSONPositive-4 65887180 578.6 ns/op 40 B/op 2 allocs/op
import "github.com/issue9/logs/v7"
l := logs.New(logs.NewTextHandler(...))
l.DEBUG().Print("debug start...")
l.ERROR().AppendAttrs(map[string]interface{}{"k1":"v1"})
l.ERROR().Printf("带默认参数 k1=v1") // 不用 With 指定 k1,err 全都自动带上此参数
go get github.com/issue9/logs/v7