Upgrading dependencies to include logrus.

This commit is contained in:
Renan DelValle 2018-11-09 15:58:49 -08:00
parent bc28198c2d
commit c03901c0f1
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
379 changed files with 90030 additions and 47 deletions

42
vendor/github.com/sirupsen/logrus/logger_test.go generated vendored Normal file
View file

@ -0,0 +1,42 @@
package logrus
import (
"bytes"
"encoding/json"
"fmt"
"testing"
"github.com/stretchr/testify/require"
)
func TestFieldValueError(t *testing.T) {
buf := &bytes.Buffer{}
l := &Logger{
Out: buf,
Formatter: new(JSONFormatter),
Hooks: make(LevelHooks),
Level: DebugLevel,
}
l.WithField("func", func() {}).Info("test")
fmt.Println(buf.String())
var data map[string]interface{}
json.Unmarshal(buf.Bytes(), &data)
_, ok := data[FieldKeyLogrusError]
require.True(t, ok)
}
func TestNoFieldValueError(t *testing.T) {
buf := &bytes.Buffer{}
l := &Logger{
Out: buf,
Formatter: new(JSONFormatter),
Hooks: make(LevelHooks),
Level: DebugLevel,
}
l.WithField("str", "str").Info("test")
fmt.Println(buf.String())
var data map[string]interface{}
json.Unmarshal(buf.Bytes(), &data)
_, ok := data[FieldKeyLogrusError]
require.False(t, ok)
}