@@ -28,9 +28,9 @@ import (
28
28
"time"
29
29
30
30
"github.com/arduino/arduino-cli/internal/arduino/builder/internal/diagnostics"
31
- "github.com/arduino/arduino-cli/internal/arduino/builder/internal/logger"
32
31
"github.com/arduino/arduino-cli/internal/arduino/builder/internal/preprocessor"
33
32
"github.com/arduino/arduino-cli/internal/arduino/builder/internal/utils"
33
+ "github.com/arduino/arduino-cli/internal/arduino/builder/logger"
34
34
"github.com/arduino/arduino-cli/internal/arduino/cores"
35
35
"github.com/arduino/arduino-cli/internal/arduino/globals"
36
36
"github.com/arduino/arduino-cli/internal/arduino/libraries"
@@ -87,7 +87,7 @@ func (l *SketchLibrariesDetector) resolveLibrary(header, platformArch string) *l
87
87
importedLibraries := l .importedLibraries
88
88
candidates := l .librariesResolver .AlternativesFor (header )
89
89
90
- if l .logger .Verbose () {
90
+ if l .logger .VerbosityLevel () == logger . VerbosityVerbose {
91
91
l .logger .Info (i18n .Tr ("Alternatives for %[1]s: %[2]s" , header , candidates ))
92
92
l .logger .Info (fmt .Sprintf ("ResolveLibrary(%s)" , header ))
93
93
l .logger .Info (fmt .Sprintf (" -> %s: %s" , i18n .Tr ("candidates" ), candidates ))
@@ -144,7 +144,7 @@ func (l *SketchLibrariesDetector) PrintUsedAndNotUsedLibraries(sketchError bool)
144
144
// - as warning, when the sketch didn't compile
145
145
// - as info, when verbose is on
146
146
// - otherwise, output nothing
147
- if ! sketchError && ! l .logger .Verbose () {
147
+ if ! sketchError && l .logger .VerbosityLevel () != logger . VerbosityVerbose {
148
148
return
149
149
}
150
150
@@ -239,7 +239,7 @@ func (l *SketchLibrariesDetector) findIncludes(
239
239
if err := json .Unmarshal (d , & l .includeFolders ); err != nil {
240
240
return err
241
241
}
242
- if l .logger .Verbose () {
242
+ if l .logger .VerbosityLevel () == logger . VerbosityVerbose {
243
243
l .logger .Info ("Using cached library discovery: " + librariesResolutionCache .String ())
244
244
}
245
245
return nil
@@ -347,12 +347,12 @@ func (l *SketchLibrariesDetector) findIncludesUntilDone(
347
347
var missingIncludeH string
348
348
if unchanged && cache .valid {
349
349
missingIncludeH = cache .Next ().Include
350
- if first && l .logger .Verbose () {
350
+ if first && l .logger .VerbosityLevel () == logger . VerbosityVerbose {
351
351
l .logger .Info (i18n .Tr ("Using cached library dependencies for file: %[1]s" , sourcePath ))
352
352
}
353
353
} else {
354
354
preprocFirstResult , preprocErr = preprocessor .GCC (ctx , sourcePath , targetFilePath , includeFolders , buildProperties )
355
- if l .logger .Verbose () {
355
+ if l .logger .VerbosityLevel () == logger . VerbosityVerbose {
356
356
l .logger .WriteStdout (preprocFirstResult .Stdout ())
357
357
}
358
358
// Unwrap error and see if it is an ExitError.
@@ -365,7 +365,7 @@ func (l *SketchLibrariesDetector) findIncludesUntilDone(
365
365
return preprocErr
366
366
} else {
367
367
missingIncludeH = IncludesFinderWithRegExp (string (preprocFirstResult .Stderr ()))
368
- if missingIncludeH == "" && l .logger .Verbose () {
368
+ if missingIncludeH == "" && l .logger .VerbosityLevel () == logger . VerbosityVerbose {
369
369
l .logger .Info (i18n .Tr ("Error while detecting libraries included by %[1]s" , sourcePath ))
370
370
}
371
371
}
@@ -383,7 +383,7 @@ func (l *SketchLibrariesDetector) findIncludesUntilDone(
383
383
if preprocErr == nil || preprocFirstResult .Stderr () == nil {
384
384
// Filename came from cache, so run preprocessor to obtain error to show
385
385
result , err := preprocessor .GCC (ctx , sourcePath , targetFilePath , includeFolders , buildProperties )
386
- if l .logger .Verbose () {
386
+ if l .logger .VerbosityLevel () == logger . VerbosityVerbose {
387
387
l .logger .WriteStdout (result .Stdout ())
388
388
}
389
389
if err == nil {
@@ -410,7 +410,7 @@ func (l *SketchLibrariesDetector) findIncludesUntilDone(
410
410
411
411
if library .Precompiled && library .PrecompiledWithSources {
412
412
// Fully precompiled libraries should have no dependencies to avoid ABI breakage
413
- if l .logger .Verbose () {
413
+ if l .logger .VerbosityLevel () == logger . VerbosityVerbose {
414
414
l .logger .Info (i18n .Tr ("Skipping dependencies detection for precompiled library %[1]s" , library .Name ))
415
415
}
416
416
} else {
0 commit comments