mirror of https://github.com/sirupsen/logrus.git
Fix logger.StdLogger to really be a plugin stdlib/log.Logger.
This commit is contained in:
parent
57071602e3
commit
97e1bef2cc
|
@ -33,7 +33,7 @@ const (
|
|||
type StandardLogger interface {
|
||||
Print(...interface{})
|
||||
Printf(string, ...interface{})
|
||||
Printfln(...interface{})
|
||||
Println(...interface{})
|
||||
|
||||
Fatal(...interface{})
|
||||
Fatalf(string, ...interface{})
|
||||
|
|
|
@ -33,6 +33,24 @@ func TestPrint(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestPrintf(t *testing.T) {
|
||||
LogAndAssertJSON(t, func(log *Logger) {
|
||||
log.Printf("%s", "test")
|
||||
}, func(fields Fields) {
|
||||
assert.Equal(t, fields["msg"], "test")
|
||||
assert.Equal(t, fields["level"], "info")
|
||||
})
|
||||
}
|
||||
|
||||
func TestPrintln(t *testing.T) {
|
||||
LogAndAssertJSON(t, func(log *Logger) {
|
||||
log.Println("test")
|
||||
}, func(fields Fields) {
|
||||
assert.Equal(t, fields["msg"], "test")
|
||||
assert.Equal(t, fields["level"], "info")
|
||||
})
|
||||
}
|
||||
|
||||
func TestInfo(t *testing.T) {
|
||||
LogAndAssertJSON(t, func(log *Logger) {
|
||||
log.Info("test")
|
||||
|
|
Loading…
Reference in New Issue