diff --git a/core/core/initutils.go b/core/core/initutils.go index 083c396a..ea26142d 100644 --- a/core/core/initutils.go +++ b/core/core/initutils.go @@ -273,10 +273,15 @@ func getAttackTracksGetter(ctx context.Context, attackTracks, accountID string, // getUIPrinter returns a printer that will be used to print to the program’s UI (terminal) func getUIPrinter(ctx context.Context, verboseMode bool, formatVersion string, attackTree bool, viewType cautils.ViewTypes) printer.IPrinter { - p := printerv2.NewPrettyPrinter(verboseMode, formatVersion, attackTree, viewType) + var p printer.IPrinter + if helpers.ToLevel(logger.L().GetLevel()) >= helpers.WarningLevel { + p = &printerv2.SilentPrinter{} + } else { + p = printerv2.NewPrettyPrinter(verboseMode, formatVersion, attackTree, viewType) - // Since the UI of the program is a CLI (Stdout), it means that it should always print to Stdout - p.SetWriter(ctx, os.Stdout.Name()) + // Since the UI of the program is a CLI (Stdout), it means that it should always print to Stdout + p.SetWriter(ctx, os.Stdout.Name()) + } return p }