trace only non nil error

pull/651/head
Darien Raymond 2017-07-25 23:12:45 +02:00
parent 6bbc3a6945
commit 2b80d096ff
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,9 @@ func getLoggerAndPrefix(s errors.Severity) (internal.LogWriter, string) {
// Trace logs an error message based on its severity.
func Trace(err error) {
if err == nil {
return
}
logger, prefix := getLoggerAndPrefix(errors.GetSeverity(err))
logger.Log(&internal.ErrorLog{
Prefix: prefix,