added more strategies

This commit is contained in:
u80864958
2025-05-09 18:32:06 +02:00
parent 2283c0f9b8
commit 4e2b95f945
8 changed files with 135 additions and 38 deletions

View File

@ -3,6 +3,7 @@ package logger_test
import (
"sync"
"testing"
"time"
"git.schreifuchs.ch/schreifuchs/logger"
"git.schreifuchs.ch/schreifuchs/logger/lvl"
@ -27,5 +28,19 @@ func TestNewWith(t *testing.T) {
if expected != got {
t.Errorf("Expected %s but got %s", expected, got)
}
}
func ExampleLog() {
log := logger.New(lvl.Debug)
log.Debug("Hello World")
log.Info("Hello World")
log.Warn("Hello World")
log.Error("Hello World")
time.Sleep(time.Second / 100)
// Output:
// Debug: Hello World
// Info: Hello World
// Warn: Hello World
// Error: Hello World
}