Files
ollama--ollama/logutil/logutil_test.go
T
2026-07-13 11:56:09 +08:00

20 lines
367 B
Go

package logutil
import (
"bytes"
"log/slog"
"strings"
"testing"
)
func TestNewLoggerAllowsSourceAttr(t *testing.T) {
var buf bytes.Buffer
logger := NewLogger(&buf, slog.LevelDebug)
logger.Debug("message", "source", "runtime")
if !strings.Contains(buf.String(), `source=runtime`) {
t.Fatalf("expected user source attr in log, got %q", buf.String())
}
}