]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/server_blackbox_test.go
Replace zap logger with slog
[rbdr/mobius] / hotline / server_blackbox_test.go
index 138a17f285ca782e64c8c2c79811c893ef9789e4..27ac4a7a313ae8108c38bba238efcd206d9a6e81 100644 (file)
@@ -4,27 +4,13 @@ import (
        "bytes"
        "encoding/hex"
        "github.com/stretchr/testify/assert"
        "bytes"
        "encoding/hex"
        "github.com/stretchr/testify/assert"
-       "go.uber.org/zap"
-       "go.uber.org/zap/zapcore"
+       "log/slog"
        "os"
        "testing"
 )
 
        "os"
        "testing"
 )
 
-func NewTestLogger() *zap.SugaredLogger {
-       encoderCfg := zap.NewProductionEncoderConfig()
-       encoderCfg.TimeKey = "timestamp"
-       encoderCfg.EncodeTime = zapcore.ISO8601TimeEncoder
-
-       core := zapcore.NewCore(
-               zapcore.NewConsoleEncoder(encoderCfg),
-               zapcore.Lock(os.Stdout),
-               zap.DebugLevel,
-       )
-
-       cores := []zapcore.Core{core}
-       l := zap.New(zapcore.NewTee(cores...))
-       defer func() { _ = l.Sync() }()
-       return l.Sugar()
+func NewTestLogger() *slog.Logger {
+       return slog.New(slog.NewTextHandler(os.Stdout, nil))
 }
 
 // assertTransferBytesEqual takes a string with a hexdump in the same format that `hexdump -C` produces and compares with
 }
 
 // assertTransferBytesEqual takes a string with a hexdump in the same format that `hexdump -C` produces and compares with