Skip to content

Commit 8f52678

Browse files
committed
Output library resolution details only at higher verbosity
This increase backward compatibility with arduino_builder
1 parent ce6c187 commit 8f52678

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

legacy/builder/resolve_library.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,15 @@ import (
4040
func ResolveLibrary(ctx *types.Context, header string) *libraries.Library {
4141
resolver := ctx.LibrariesResolver
4242
importedLibraries := ctx.ImportedLibraries
43-
logger := ctx.GetLogger()
4443

4544
candidates := resolver.AlternativesFor(header)
46-
logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf("Alternatives for %s: %s", header, candidates))
47-
logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf("ResolveLibrary(%s)", header))
48-
logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf(" -> candidates: %s", candidates))
45+
46+
logger := ctx.GetLogger()
47+
if ctx.Verbose {
48+
logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf("Alternatives for %s: %s", header, candidates))
49+
logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf("ResolveLibrary(%s)", header))
50+
logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf(" -> candidates: %s", candidates))
51+
}
4952

5053
if candidates == nil || len(candidates) == 0 {
5154
return nil

0 commit comments

Comments
 (0)