Logger migration from log15 to gokit/log (#41636)

* migrate log15 to gokit/log

* fix console log

* update some unittest

* fix all unittest

* fix the build

* Update pkg/infra/log/log.go

Co-authored-by: Yuriy Tseretyan <tceretian@gmail.com>

* general type vector

* correct the level key

Co-authored-by: Yuriy Tseretyan <tceretian@gmail.com>
This commit is contained in:
ying-jeanne
2022-01-06 22:28:05 +08:00
committed by GitHub
co-authored by Yuriy Tseretyan
parent 8898a5f0a0
commit a8eef45a44
17 changed files with 628 additions and 321 deletions
+2 -9
View File
@@ -1,7 +1,5 @@
package log
import "github.com/inconshreveable/log15"
type Lvl int
const (
@@ -14,18 +12,13 @@ const (
type Logger interface {
// New returns a new Logger that has this logger's context plus the given context
New(ctx ...interface{}) log15.Logger
New(ctx ...interface{}) MultiLoggers
// GetHandler gets the handler associated with the logger.
GetHandler() log15.Handler
// SetHandler updates the logger to write records to the specified handler.
SetHandler(h log15.Handler)
Log(keyvals ...interface{}) error
// Log a message at the given level with context key/value pairs
Debug(msg string, ctx ...interface{})
Info(msg string, ctx ...interface{})
Warn(msg string, ctx ...interface{})
Error(msg string, ctx ...interface{})
Crit(msg string, ctx ...interface{})
}