Merge pull request #2789 from kolyshkin/error-trace

This commit is contained in:
Akihiro Suda
2021-02-05 15:21:56 +09:00
committed by GitHub
+2
View File
@@ -55,6 +55,8 @@ func logrusToStderr() bool {
func fatal(err error) {
// make sure the error is written to the logger
logrus.Error(err)
// If debug is enabled and pkg/errors was used, show its stack trace.
logrus.Debugf("%+v", err)
if !logrusToStderr() {
fmt.Fprintln(os.Stderr, err)
}