4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-06 22:24:06 +00:00

Update vendor (#852)

This commit is contained in:
Wim
2019-06-16 23:33:25 +02:00
committed by GitHub
parent f4ae610448
commit cb712ff37d
294 changed files with 71447 additions and 6861 deletions

View File

@ -2,6 +2,7 @@ package middleware
import (
"bytes"
"encoding/json"
"io"
"os"
"strconv"
@ -20,7 +21,7 @@ type (
// Skipper defines a function to skip middleware.
Skipper Skipper
// Tags to constructed the logger format.
// Tags to construct the logger format.
//
// - time_unix
// - time_unix_nano
@ -175,7 +176,10 @@ func LoggerWithConfig(config LoggerConfig) echo.MiddlewareFunc {
return buf.WriteString(s)
case "error":
if err != nil {
return buf.WriteString(err.Error())
// Error may contain invalid JSON e.g. `"`
b, _ := json.Marshal(err.Error())
b = b[1 : len(b)-1]
return buf.Write(b)
}
case "latency":
l := stop.Sub(start)