Skip to content

Commit 2a5d80a

Browse files
Pete Stevensoncopybaranaut
authored andcommitted
px cli: Stop showing spinners in quiet mode.
Summary: Previously, even with `-q|-quiet`, the px cli would show spinners which can cause log spam. In this diff, we remove the spinners if quiet mode is enabled. Test Plan: Tested locally, in continuous use by the stirling perf eval project. Reviewers: #stirling, michelle, vihang, zasgar Reviewed By: vihang Subscribers: yzhao Signed-off-by: Pete Stevenson <jps@pixielabs.ai> Differential Revision: https://phab.corp.pixielabs.ai/D11834 GitOrigin-RevId: 5f5b69f
1 parent 2b3a7b2 commit 2a5d80a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/pixie_cli/pkg/components/spinner.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"fmt"
2323

2424
"github.com/fatih/color"
25+
"github.com/spf13/viper"
2526
"github.com/vbauerster/mpb/v4"
2627
"github.com/vbauerster/mpb/v4/decor"
2728
)
@@ -50,8 +51,13 @@ type SpinnerTable struct {
5051

5152
// NewSpinnerTable creates a new table with Spinners.
5253
func NewSpinnerTable() *SpinnerTable {
54+
var opt mpb.ContainerOption
55+
if viper.GetBool("quiet") {
56+
opt = mpb.WithOutput(nil)
57+
}
58+
5359
return &SpinnerTable{
54-
mpb.New(),
60+
mpb.New(opt),
5561
make([]*TaskInfo, 0),
5662
}
5763
}

0 commit comments

Comments
 (0)