@@ -28,9 +28,9 @@ import (
2828 "time"
2929
3030 "github.com/arduino/arduino-cli/internal/arduino/builder/internal/diagnostics"
31- "github.com/arduino/arduino-cli/internal/arduino/builder/internal/logger"
3231 "github.com/arduino/arduino-cli/internal/arduino/builder/internal/preprocessor"
3332 "github.com/arduino/arduino-cli/internal/arduino/builder/internal/utils"
33+ "github.com/arduino/arduino-cli/internal/arduino/builder/logger"
3434 "github.com/arduino/arduino-cli/internal/arduino/cores"
3535 "github.com/arduino/arduino-cli/internal/arduino/globals"
3636 "github.com/arduino/arduino-cli/internal/arduino/libraries"
@@ -87,7 +87,7 @@ func (l *SketchLibrariesDetector) resolveLibrary(header, platformArch string) *l
8787 importedLibraries := l .importedLibraries
8888 candidates := l .librariesResolver .AlternativesFor (header )
8989
90- if l .logger .Verbose () {
90+ if l .logger .VerbosityLevel () == logger . VerbosityVerbose {
9191 l .logger .Info (i18n .Tr ("Alternatives for %[1]s: %[2]s" , header , candidates ))
9292 l .logger .Info (fmt .Sprintf ("ResolveLibrary(%s)" , header ))
9393 l .logger .Info (fmt .Sprintf (" -> %s: %s" , i18n .Tr ("candidates" ), candidates ))
@@ -144,7 +144,7 @@ func (l *SketchLibrariesDetector) PrintUsedAndNotUsedLibraries(sketchError bool)
144144 // - as warning, when the sketch didn't compile
145145 // - as info, when verbose is on
146146 // - otherwise, output nothing
147- if ! sketchError && ! l .logger .Verbose () {
147+ if ! sketchError && l .logger .VerbosityLevel () != logger . VerbosityVerbose {
148148 return
149149 }
150150
@@ -239,7 +239,7 @@ func (l *SketchLibrariesDetector) findIncludes(
239239 if err := json .Unmarshal (d , & l .includeFolders ); err != nil {
240240 return err
241241 }
242- if l .logger .Verbose () {
242+ if l .logger .VerbosityLevel () == logger . VerbosityVerbose {
243243 l .logger .Info ("Using cached library discovery: " + librariesResolutionCache .String ())
244244 }
245245 return nil
@@ -347,12 +347,12 @@ func (l *SketchLibrariesDetector) findIncludesUntilDone(
347347 var missingIncludeH string
348348 if unchanged && cache .valid {
349349 missingIncludeH = cache .Next ().Include
350- if first && l .logger .Verbose () {
350+ if first && l .logger .VerbosityLevel () == logger . VerbosityVerbose {
351351 l .logger .Info (i18n .Tr ("Using cached library dependencies for file: %[1]s" , sourcePath ))
352352 }
353353 } else {
354354 preprocFirstResult , preprocErr = preprocessor .GCC (ctx , sourcePath , targetFilePath , includeFolders , buildProperties )
355- if l .logger .Verbose () {
355+ if l .logger .VerbosityLevel () == logger . VerbosityVerbose {
356356 l .logger .WriteStdout (preprocFirstResult .Stdout ())
357357 }
358358 // Unwrap error and see if it is an ExitError.
@@ -365,7 +365,7 @@ func (l *SketchLibrariesDetector) findIncludesUntilDone(
365365 return preprocErr
366366 } else {
367367 missingIncludeH = IncludesFinderWithRegExp (string (preprocFirstResult .Stderr ()))
368- if missingIncludeH == "" && l .logger .Verbose () {
368+ if missingIncludeH == "" && l .logger .VerbosityLevel () == logger . VerbosityVerbose {
369369 l .logger .Info (i18n .Tr ("Error while detecting libraries included by %[1]s" , sourcePath ))
370370 }
371371 }
@@ -383,7 +383,7 @@ func (l *SketchLibrariesDetector) findIncludesUntilDone(
383383 if preprocErr == nil || preprocFirstResult .Stderr () == nil {
384384 // Filename came from cache, so run preprocessor to obtain error to show
385385 result , err := preprocessor .GCC (ctx , sourcePath , targetFilePath , includeFolders , buildProperties )
386- if l .logger .Verbose () {
386+ if l .logger .VerbosityLevel () == logger . VerbosityVerbose {
387387 l .logger .WriteStdout (result .Stdout ())
388388 }
389389 if err == nil {
@@ -410,7 +410,7 @@ func (l *SketchLibrariesDetector) findIncludesUntilDone(
410410
411411 if library .Precompiled && library .PrecompiledWithSources {
412412 // Fully precompiled libraries should have no dependencies to avoid ABI breakage
413- if l .logger .Verbose () {
413+ if l .logger .VerbosityLevel () == logger . VerbosityVerbose {
414414 l .logger .Info (i18n .Tr ("Skipping dependencies detection for precompiled library %[1]s" , library .Name ))
415415 }
416416 } else {
0 commit comments