Skip to content

Commit

Permalink
Fail if there's no log files
Browse files Browse the repository at this point in the history
If we don't glob any files, something has gone wrong.

Log the number of files tailed otherwise
  • Loading branch information
mcpherrinm committed Nov 9, 2023
1 parent 982022a commit 9f73fd6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/log-validator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ func main() {
}
}

if len(tailers) == 0 {
cmd.Fail("No log files to monitor")
} else {
logger.Infof("Tailing %d files", len(tailers))
}

defer func() {
for _, t := range tailers {
// The tail module seems to have a race condition that will generate
Expand Down

0 comments on commit 9f73fd6

Please sign in to comment.