Files
loggerx/loggerx_test.go
T

27 lines
486 B
Go
Raw Normal View History

2024-01-22 18:05:51 +08:00
package loggerx_test
import (
"context"
"testing"
2024-01-23 13:37:51 +08:00
"time"
2024-01-22 18:05:51 +08:00
"code.yun.ink/pkg/loggerx"
)
// func TestMain(m *testing.M) {
// }
func TestLogger(t *testing.T) {
2024-01-23 00:12:08 +08:00
l := loggerx.NewLogger(loggerx.SetErrorToInfo())
2024-01-22 18:05:51 +08:00
l.Error(context.Background(), "test error")
2024-04-03 21:18:44 +08:00
l.Channel("channel1").Error(context.Background(), "channel1 test error")
l.Channel("channel2").Error(context.Background(), "channel2 test error")
2024-01-23 00:12:08 +08:00
l.Info(context.Background(), "test info")
2024-02-03 01:57:56 +08:00
time.Sleep(time.Second * 5)
2024-01-22 18:05:51 +08:00
}