Skip to content

Commit

Permalink
zed manage: Quiet logger if -q flag is active (#5051)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnibs authored Feb 29, 2024
1 parent 87deeeb commit e212199
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cmd/zed/manage/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/brimdata/zed/cmd/zed/internal/lakemanage"
"github.com/brimdata/zed/cmd/zed/root"
"github.com/brimdata/zed/pkg/charm"
"go.uber.org/zap"
"gopkg.in/yaml.v3"
)

Expand Down Expand Up @@ -52,11 +53,14 @@ func (c *Command) Run(args []string) error {
return err
}
defer cleanup()
logger, err := c.logFlags.Open()
if err != nil {
return err
logger := zap.NewNop()
if !c.LakeFlags.Quiet {
logger, err = c.logFlags.Open()
if err != nil {
return err
}
defer logger.Sync()
}
defer logger.Sync()
if c.monitor {
conn, err := c.LakeFlags.Connection()
if err != nil {
Expand Down

0 comments on commit e212199

Please sign in to comment.