fix: avoid instantiating a logger if provided /dev/null (#24027)

- Adds some additional context to workspace traffic logging
- Fails traffic tests if 0 bytes read from connection
This commit is contained in:
Jon Ayers
2026-04-03 16:26:14 -05:00
committed by GitHub
parent a1d51f0dab
commit 7e63fe68f7
4 changed files with 37 additions and 3 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ func (b *Builder) Build(inv *serpent.Invocation) (log slog.Logger, closeLog func
addSinkIfProvided := func(sinkFn func(io.Writer) slog.Sink, loc string) error {
switch loc {
case "":
case "", "/dev/null":
case "/dev/stdout":
sinks = append(sinks, sinkFn(inv.Stdout))