mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 08:32:40 +08:00
logx
This commit is contained in:
26
logx/logrus_options_test.go
Normal file
26
logx/logrus_options_test.go
Normal file
@ -0,0 +1,26 @@
|
||||
package logx_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/charlienet/go-mixed/logx"
|
||||
)
|
||||
|
||||
func TestNewLogrus(t *testing.T) {
|
||||
_ = logx.WithOutput(logx.LogrusOutputOptions{
|
||||
Output: logx.Console,
|
||||
})
|
||||
}
|
||||
|
||||
func TestFileOutput(t *testing.T) {
|
||||
t.Log(os.Getwd())
|
||||
logger := logx.NewLogrus(
|
||||
// logx.WithFormatter(&logrus.TextFormatter{}),
|
||||
logx.WithOptions(logx.LogrusOptions{ShowCaller: true}),
|
||||
logx.WithOutput(logx.LogrusOutputOptions{
|
||||
FileName: "abc.log",
|
||||
}))
|
||||
|
||||
logger.Info("abc")
|
||||
}
|
Reference in New Issue
Block a user