Skip to content

Commit

Permalink
fix: local backend segfaults with up --verbose
Browse files Browse the repository at this point in the history
We were passing Logger=nil to the Tail package, which is what its docs state will result in using its default logger. Unfortunately we rather see a null pointer segfault.

Signed-off-by: Nick Mitchell <[email protected]>
  • Loading branch information
starpit committed Sep 24, 2024
1 parent 2350411 commit 7266b6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/be/local/streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"log"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -253,8 +254,7 @@ func (s localStreamer) ComponentLogs(c lunchpail.Component, opts streamer.LogOpt
func tailfChan(outfile string, opts streamer.LogOptions) (*tail.Tail, error) {
Logger := tail.DiscardingLogger
if opts.Verbose {
// this tells tailf to use its default logger
Logger = nil
Logger = log.New(os.Stderr, "", log.LstdFlags)
}

return tail.TailFile(outfile, tail.Config{Follow: opts.Follow, ReOpen: opts.Follow, Logger: Logger})
Expand Down

0 comments on commit 7266b6c

Please sign in to comment.