Skip to content

Commit 2da824d

Browse files
committed
Replace logger with utils.LogIfVerbose
1 parent 9b2842c commit 2da824d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: legacy/builder/merge_sketch_with_bootloader.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ package builder
1717

1818
import (
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

Comments
 (0)