diff --git a/commands/service_compile.go b/commands/service_compile.go index 2ca418df7cf..24cbfd52b2c 100644 --- a/commands/service_compile.go +++ b/commands/service_compile.go @@ -246,6 +246,9 @@ func (s *arduinoCoreServerImpl) Compile(req *rpc.CompileRequest, stream rpc.Ardu }) } var verbosity logger.Verbosity = logger.VerbosityNormal + if req.GetQuiet() { + verbosity = logger.VerbosityQuiet + } if req.GetVerbose() { verbosity = logger.VerbosityVerbose } diff --git a/internal/arduino/builder/sizer.go b/internal/arduino/builder/sizer.go index a9ac3de2c8c..ae188b48f2b 100644 --- a/internal/arduino/builder/sizer.go +++ b/internal/arduino/builder/sizer.go @@ -156,19 +156,21 @@ func (b *Builder) checkSize() (ExecutablesFileSections, error) { return nil, nil } - b.logger.Info(i18n.Tr("Sketch uses %[1]s bytes (%[3]s%%) of program storage space. Maximum is %[2]s bytes.", - strconv.Itoa(textSize), - strconv.Itoa(maxTextSize), - strconv.Itoa(textSize*100/maxTextSize))) - if dataSize >= 0 { - if maxDataSize > 0 { - b.logger.Info(i18n.Tr("Global variables use %[1]s bytes (%[3]s%%) of dynamic memory, leaving %[4]s bytes for local variables. Maximum is %[2]s bytes.", - strconv.Itoa(dataSize), - strconv.Itoa(maxDataSize), - strconv.Itoa(dataSize*100/maxDataSize), - strconv.Itoa(maxDataSize-dataSize))) - } else { - b.logger.Info(i18n.Tr("Global variables use %[1]s bytes of dynamic memory.", strconv.Itoa(dataSize))) + if b.logger.VerbosityLevel() > logger.VerbosityQuiet { + b.logger.Info(i18n.Tr("Sketch uses %[1]s bytes (%[3]s%%) of program storage space. Maximum is %[2]s bytes.", + strconv.Itoa(textSize), + strconv.Itoa(maxTextSize), + strconv.Itoa(textSize*100/maxTextSize))) + if dataSize >= 0 { + if maxDataSize > 0 { + b.logger.Info(i18n.Tr("Global variables use %[1]s bytes (%[3]s%%) of dynamic memory, leaving %[4]s bytes for local variables. Maximum is %[2]s bytes.", + strconv.Itoa(dataSize), + strconv.Itoa(maxDataSize), + strconv.Itoa(dataSize*100/maxDataSize), + strconv.Itoa(maxDataSize-dataSize))) + } else { + b.logger.Info(i18n.Tr("Global variables use %[1]s bytes of dynamic memory.", strconv.Itoa(dataSize))) + } } }