phuslu / log

Fastest structured logging
MIT License
672 stars 44 forks source link

log.Fatal() 会崩溃 #1

Closed airystar closed 4 years ago

airystar commented 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

phuslu commented 4 years ago

嗯,设计 fatal 的确是打印堆栈并退出哎。

https://github.com/phuslu/log/blob/master/json.go#L233-L234

phuslu commented 4 years ago

标准库也是这个行为呀 https://godoc.org/log#Fatal