17 lines
428 B
Go
17 lines
428 B
Go
package lormatter_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
"gitter.top/common/lormatter"
|
|
)
|
|
|
|
func TestFormatterDefaultFormat(t *testing.T) {
|
|
formatter := &lormatter.Formatter{ShowTime: true, ShowFile: true, ShowField: true}
|
|
logrus.SetFormatter(formatter)
|
|
logrus.SetReportCaller(true)
|
|
logrus.WithField("key", "value").WithField("tag", "hahaha").Infof("Infof Log message")
|
|
logrus.Warnf("Warnf Log message")
|
|
}
|