forked from mirror/logrus
Merge pull request #6 from aybabtme/typo_in_println
Fix logger.StdLogger to really be a plugin stdlib/log.Logger.
This commit is contained in:
commit
c26c4c5ff6
13
logrus.go
13
logrus.go
|
@ -1,5 +1,9 @@
|
|||
package logrus
|
||||
|
||||
import (
|
||||
"log"
|
||||
)
|
||||
|
||||
// Fields type, used to pass to `WithFields`.
|
||||
type Fields map[string]interface{}
|
||||
|
||||
|
@ -27,13 +31,16 @@ const (
|
|||
Debug
|
||||
)
|
||||
|
||||
// StandardLogger is what your logrus-enabled library should take, that way
|
||||
// Won't compile if StdLogger can't be realized by a log.Logger
|
||||
var _ StdLogger = &log.Logger{}
|
||||
|
||||
// StdLogger is what your logrus-enabled library should take, that way
|
||||
// it'll accept a stdlib logger and a logrus logger. There's no standard
|
||||
// interface, this is the closest we get, unfortunately.
|
||||
type StandardLogger interface {
|
||||
type StdLogger interface {
|
||||
Print(...interface{})
|
||||
Printf(string, ...interface{})
|
||||
Printfln(...interface{})
|
||||
Println(...interface{})
|
||||
|
||||
Fatal(...interface{})
|
||||
Fatalf(string, ...interface{})
|
||||
|
|
Loading…
Reference in New Issue