As described in the README, log.Fatal calls os.Exit(1) and log.Panic calls panic(). However, using entry.Log calls panic() at Panic level, but does nothing other than emitting the entry at Fatal level.
// Warning: using Log at Panic or Fatal level will not respectively Panic nor Exit.
// For this behaviour Entry.Panic or Entry.Fatal should be used instead.
It's not clear whether the code documentation is correct or if the behavior of the code is correct. Either way, it should be consistent and possibly documented at a more visible level, such as in the README.
As described in the README,
log.Fatal
callsos.Exit(1)
andlog.Panic
callspanic()
. However, usingentry.Log
callspanic()
at Panic level, but does nothing other than emitting the entry at Fatal level.This is documented in the code here:
It's not clear whether the code documentation is correct or if the behavior of the code is correct. Either way, it should be consistent and possibly documented at a more visible level, such as in the README.