From 24a0ade23b9715f3bd3b3d08393018d6d209e654 Mon Sep 17 00:00:00 2001 From: donnie4w Date: Tue, 1 Oct 2024 11:25:46 +0800 Subject: [PATCH] Update logging_test.go --- logger/logging_test.go | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/logger/logging_test.go b/logger/logging_test.go index e62ccba..f420041 100644 --- a/logger/logging_test.go +++ b/logger/logging_test.go @@ -5,7 +5,6 @@ import ( "log/slog" "path/filepath" "strconv" - "sync" "testing" "time" ) @@ -55,32 +54,6 @@ func Test_LogOne(t *testing.T) { time.Sleep(2 * time.Second) } -func BenchmarkSerialLog(b *testing.B) { - b.StopTimer() - log := NewLogger() - log.SetRollingFile(`./`, "log1.txt", 100, MB) - log.SetConsole(false) - // log.SetFormat(FORMAT_NANO) - b.StartTimer() - wg := sync.WaitGroup{} - for i := 0; i < 100; i++ { - wg.Add(1) - - go func() { - for i := 0; i < b.N; i++ { - // log.Write([]byte(">>>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) - log.Debug(i, ">>>this is debug message") - // log.Info(i, ">>>this is info message") - // log.Warn(i, ">>>this is warm message") - // log.log.Error(i, ">>>this is error message") - } - wg.Done() - }() - } - wg.Wait() - -} - func TestSlog(t *testing.T) { replace := func(groups []string, a slog.Attr) slog.Attr { if a.Key == slog.SourceKey {