File tree Expand file tree Collapse file tree 4 files changed +20
-12
lines changed Expand file tree Collapse file tree 4 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -267,8 +267,8 @@ func (e *Echo) SetLogOutput(w io.Writer) {
267
267
e .logger .SetOutput (w )
268
268
}
269
269
270
- // SetLogLevel sets the log level for the logger. Default value `3` ( ERROR) .
271
- func (e * Echo ) SetLogLevel (l uint8 ) {
270
+ // SetLogLevel sets the log level for the logger. Default value ERROR.
271
+ func (e * Echo ) SetLogLevel (l glog. Lvl ) {
272
272
e .logger .SetLevel (l )
273
273
}
274
274
Original file line number Diff line number Diff line change 1
1
package log
2
2
3
- import "io"
3
+ import (
4
+ "io"
5
+
6
+ "github.com/labstack/gommon/log"
7
+ )
4
8
5
9
type (
6
10
// Logger defines the logging interface.
7
11
Logger interface {
8
12
SetOutput (io.Writer )
9
- SetLevel (uint8 )
13
+ SetLevel (log. Lvl )
10
14
Print (... interface {})
11
15
Printf (string , ... interface {})
16
+ Printj (log.JSON )
12
17
Debug (... interface {})
13
18
Debugf (string , ... interface {})
19
+ Debugj (log.JSON )
14
20
Info (... interface {})
15
21
Infof (string , ... interface {})
22
+ Infoj (log.JSON )
16
23
Warn (... interface {})
17
24
Warnf (string , ... interface {})
25
+ Warnj (log.JSON )
18
26
Error (... interface {})
19
27
Errorf (string , ... interface {})
28
+ Errorj (log.JSON )
20
29
Fatal (... interface {})
30
+ Fatalj (log.JSON )
21
31
Fatalf (string , ... interface {})
22
32
}
23
33
)
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package middleware
2
2
3
3
import (
4
4
"bytes"
5
- "fmt"
6
5
"io"
7
6
"net"
8
7
"os"
@@ -158,9 +157,8 @@ func LoggerWithConfig(config LoggerConfig) echo.MiddlewareFunc {
158
157
return w .Write ([]byte (b ))
159
158
case "tx_bytes" :
160
159
return w .Write ([]byte (strconv .FormatInt (res .Size (), 10 )))
161
- default :
162
- return w .Write ([]byte (fmt .Sprintf ("[unknown tag %s]" , tag )))
163
160
}
161
+ return 0 , nil
164
162
})
165
163
if err == nil {
166
164
config .Output .Write (buf .Bytes ())
You can’t perform that action at this time.
0 commit comments