1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00
This commit is contained in:
2022-04-22 14:32:29 +08:00
parent efc8210d97
commit f7df1f1668
10 changed files with 276 additions and 82 deletions

View 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")
}