mirror of https://github.com/containers/podman.git
At trace log level, print error text using %+v instead of %v
If we're logging at trace level, use %+v instead of %v when printing an error at exit. If the error included stack information, this will cause the backtrace to be printed, which is very handy for debugging. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
parent
9b3226a80a
commit
6bde4d00dd
|
@ -416,7 +416,11 @@ func formatError(err error) string {
|
||||||
strings.TrimSuffix(err.Error(), ": "+define.ErrOCIRuntime.Error()),
|
strings.TrimSuffix(err.Error(), ": "+define.ErrOCIRuntime.Error()),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
message = "Error: " + err.Error()
|
if logrus.IsLevelEnabled(logrus.TraceLevel) {
|
||||||
|
message = fmt.Sprintf("Error: %+v", err)
|
||||||
|
} else {
|
||||||
|
message = fmt.Sprintf("Error: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return message
|
return message
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue