Skip to content

Commit a375218

Browse files
authored
Support slog_level in hammer (#909)
This got missed in #896 and is likely the cause of the conformance failures.
1 parent a1e0ccb commit a375218

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

internal/hammer/hammer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,14 @@ var (
7272

7373
httpTimeout = flag.Duration("http_timeout", 30*time.Second, "Timeout for HTTP requests")
7474
forceHTTP2 = flag.Bool("force_http2", false, "Use HTTP/2 connections *only*")
75+
slogLevel = flag.Int("slog_level", 0, "The cut-off threshold for structured logging. Default is 0 (INFO). See https://pkg.go.dev/log/slog#Level for other levels.")
7576

7677
hc *http.Client
7778
)
7879

7980
func main() {
8081
flag.Parse()
82+
slog.SetDefault(slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.Level(*slogLevel)})))
8183

8284
hc = &http.Client{
8385
Transport: &http.Transport{

0 commit comments

Comments
 (0)