aboutsummaryrefslogtreecommitdiff
path: root/api/logger.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/logger.go')
-rw-r--r--api/logger.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/api/logger.go b/api/logger.go
index a24e08a..5f49d29 100644
--- a/api/logger.go
+++ b/api/logger.go
@@ -2,7 +2,6 @@ package api
2 2
3import ( 3import (
4 "fmt" 4 "fmt"
5 "strings"
6 "time" 5 "time"
7 6
8 "github.com/Sirupsen/logrus" 7 "github.com/Sirupsen/logrus"
@@ -51,11 +50,14 @@ func Logger() gin.HandlerFunc {
51 level = logrus.ErrorLevel 50 level = logrus.ErrorLevel
52 } 51 }
53 52
54 comment := c.Errors.ByType(gin.ErrorTypePrivate).String() 53 errors := c.Errors.ByType(gin.ErrorTypePrivate)
55 if comment != "" { 54
56 msgLog = fmt.Sprintf("%s: %s", msgLog, strings.TrimSpace(comment)) 55 for _, err := range errors {
56 l.Logf(level, "%s: %s", msgLog, err.Err)
57 } 57 }
58 58
59 l.Logf(level, msgLog) 59 if errors == nil {
60 l.Logf(level, msgLog)
61 }
60 } 62 }
61} 63}