Closed airystar closed 4 years ago
请运行这个: package main import "github.com/phuslu/log" func main() { log.Fatal().Str("foo", "bar").Int("number", 42).Msg("a structured logger") } or https://play.golang.org/p/mapv1Ferz8T tks
package main import "github.com/phuslu/log" func main() { log.Fatal().Str("foo", "bar").Int("number", 42).Msg("a structured logger") }
嗯,设计 fatal 的确是打印堆栈并退出哎。
https://github.com/phuslu/log/blob/master/json.go#L233-L234
标准库也是这个行为呀 https://godoc.org/log#Fatal
请运行这个:
package main import "github.com/phuslu/log" func main() { log.Fatal().Str("foo", "bar").Int("number", 42).Msg("a structured logger") }
or https://play.golang.org/p/mapv1Ferz8T tks