@@ -17,12 +17,12 @@ package builder
1717
1818import (
1919 "math"
20- "os"
2120 "strconv"
2221 "strings"
2322
2423 "github.com/arduino/arduino-cli/legacy/builder/constants"
2524 "github.com/arduino/arduino-cli/legacy/builder/types"
25+ "github.com/arduino/arduino-cli/legacy/builder/utils"
2626 "github.com/arduino/go-paths-helper"
2727 "github.com/marcinbor85/gohex"
2828 "github.com/pkg/errors"
@@ -39,7 +39,6 @@ func (s *MergeSketchWithBootloader) Run(ctx *types.Context) error {
3939 buildPath := ctx .BuildPath
4040 sketch := ctx .Sketch
4141 sketchFileName := sketch .MainFile .Name .Base ()
42- logger := ctx .GetLogger ()
4342
4443 sketchInBuildPath := buildPath .Join (sketchFileName + ".hex" )
4544 sketchInSubfolder := buildPath .Join (constants .FOLDER_SKETCH , sketchFileName + ".hex" )
@@ -63,7 +62,7 @@ func (s *MergeSketchWithBootloader) Run(ctx *types.Context) error {
6362
6463 bootloaderPath := buildProperties .GetPath (constants .BUILD_PROPERTIES_RUNTIME_PLATFORM_PATH ).Join (constants .FOLDER_BOOTLOADERS , bootloader )
6564 if bootloaderPath .NotExist () {
66- logger . Fprintln ( os . Stdout , constants .LOG_LEVEL_WARN , constants .MSG_BOOTLOADER_FILE_MISSING , bootloaderPath )
65+ utils . LogIfVerbose ( constants .LOG_LEVEL_WARN , constants .MSG_BOOTLOADER_FILE_MISSING , bootloaderPath )
6766 return nil
6867 }
6968
@@ -77,7 +76,7 @@ func (s *MergeSketchWithBootloader) Run(ctx *types.Context) error {
7776 }
7877 err := merge (builtSketchPath , bootloaderPath , mergedSketchPath , maximumBinSize )
7978 if err != nil {
80- logger . Fprintln ( os . Stdout , constants .LOG_LEVEL_WARN , err .Error ())
79+ utils . LogIfVerbose ( constants .LOG_LEVEL_INFO , err .Error ())
8180 }
8281
8382 return nil
0 commit comments