From 8f526780917a9be27ca2e4acdd807d180e984e8b Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 27 Aug 2019 12:16:05 +0200 Subject: [PATCH] Output library resolution details only at higher verbosity This increase backward compatibility with arduino_builder --- legacy/builder/resolve_library.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/legacy/builder/resolve_library.go b/legacy/builder/resolve_library.go index 66694cc09c2..cc1887c5de8 100644 --- a/legacy/builder/resolve_library.go +++ b/legacy/builder/resolve_library.go @@ -40,12 +40,15 @@ import ( func ResolveLibrary(ctx *types.Context, header string) *libraries.Library { resolver := ctx.LibrariesResolver importedLibraries := ctx.ImportedLibraries - logger := ctx.GetLogger() candidates := resolver.AlternativesFor(header) - logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf("Alternatives for %s: %s", header, candidates)) - logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf("ResolveLibrary(%s)", header)) - logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf(" -> candidates: %s", candidates)) + + logger := ctx.GetLogger() + if ctx.Verbose { + logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf("Alternatives for %s: %s", header, candidates)) + logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf("ResolveLibrary(%s)", header)) + logger.Println(constants.LOG_LEVEL_INFO, fmt.Sprintf(" -> candidates: %s", candidates)) + } if candidates == nil || len(candidates) == 0 { return nil