@@ -55,7 +55,7 @@ func (pm *PackageManager) LoadHardwareFromDirectories(hardwarePaths paths.PathLi
5555// LoadHardwareFromDirectory read a plaform from the path passed as parameter
5656func (pm * PackageManager ) LoadHardwareFromDirectory (path * paths.Path ) []error {
5757 var merr []error
58- pm .Log .Infof ("Loading hardware from: %s" , path )
58+ pm .log .Infof ("Loading hardware from: %s" , path )
5959 if err := path .ToAbs (); err != nil {
6060 return append (merr , fmt .Errorf ("%s: %w" , tr ("finding absolute path of %s" , path ), err ))
6161 }
@@ -76,9 +76,9 @@ func (pm *PackageManager) LoadHardwareFromDirectory(path *paths.Path) []error {
7676 // "Global" platform.txt used to overwrite all installed platforms.
7777 // For more info: https://arduino.github.io/arduino-cli/latest/platform-specification/#global-platformtxt
7878 if globalPlatformTxt := path .Join ("platform.txt" ); globalPlatformTxt .Exist () {
79- pm .Log .Infof ("Loading custom platform properties: %s" , globalPlatformTxt )
79+ pm .log .Infof ("Loading custom platform properties: %s" , globalPlatformTxt )
8080 if p , err := properties .LoadFromPath (globalPlatformTxt ); err != nil {
81- pm .Log .WithError (err ).Errorf ("Error loading properties." )
81+ pm .log .WithError (err ).Errorf ("Error loading properties." )
8282 } else {
8383 pm .CustomGlobalProperties .Merge (p )
8484 }
@@ -89,7 +89,7 @@ func (pm *PackageManager) LoadHardwareFromDirectory(path *paths.Path) []error {
8989
9090 // Skip tools, they're not packages and don't contain Platforms
9191 if packager == "tools" {
92- pm .Log .Infof ("Excluding directory: %s" , packagerPath )
92+ pm .log .Infof ("Excluding directory: %s" , packagerPath )
9393 continue
9494 }
9595
@@ -127,7 +127,7 @@ func (pm *PackageManager) LoadHardwareFromDirectory(path *paths.Path) []error {
127127 // - PACKAGER/tools/TOOL-NAME/TOOL-VERSION/... (ex: arduino/tools/bossac/1.7.0/...)
128128 toolsSubdirPath := packagerPath .Join ("tools" )
129129 if toolsSubdirPath .IsDir () {
130- pm .Log .Infof ("Checking existence of 'tools' path: %s" , toolsSubdirPath )
130+ pm .log .Infof ("Checking existence of 'tools' path: %s" , toolsSubdirPath )
131131 merr = append (merr , pm .LoadToolsFromPackageDir (targetPackage , toolsSubdirPath )... )
132132 }
133133 // If the Package does not contain Platforms or Tools we remove it since does not contain anything valuable
@@ -143,7 +143,7 @@ func (pm *PackageManager) LoadHardwareFromDirectory(path *paths.Path) []error {
143143// to the targetPackage object passed as parameter.
144144// A list of gRPC Status error is returned for each Platform failed to load.
145145func (pm * PackageManager ) loadPlatforms (targetPackage * cores.Package , packageDir * paths.Path ) []error {
146- pm .Log .Infof ("Loading package %s from: %s" , targetPackage .Name , packageDir )
146+ pm .log .Infof ("Loading package %s from: %s" , targetPackage .Name , packageDir )
147147
148148 var merr []error
149149
@@ -220,11 +220,11 @@ func (pm *PackageManager) loadPlatform(targetPackage *cores.Package, architectur
220220 tmp := cores .NewPackages ()
221221 index .MergeIntoPackages (tmp )
222222 if tmpPackage := tmp .GetOrCreatePackage (targetPackage .Name ); tmpPackage == nil {
223- pm .Log .Warnf ("Can't determine bundle platform version for %s" , targetPackage .Name )
223+ pm .log .Warnf ("Can't determine bundle platform version for %s" , targetPackage .Name )
224224 } else if tmpPlatform := tmpPackage .GetOrCreatePlatform (architecture ); tmpPlatform == nil {
225- pm .Log .Warnf ("Can't determine bundle platform version for %s:%s" , targetPackage .Name , architecture )
225+ pm .log .Warnf ("Can't determine bundle platform version for %s:%s" , targetPackage .Name , architecture )
226226 } else if tmpPlatformRelease := tmpPlatform .GetLatestRelease (); tmpPlatformRelease == nil {
227- pm .Log .Warnf ("Can't determine bundle platform version for %s:%s, no valid release found" , targetPackage .Name , architecture )
227+ pm .log .Warnf ("Can't determine bundle platform version for %s:%s, no valid release found" , targetPackage .Name , architecture )
228228 } else {
229229 version = tmpPlatformRelease .Version
230230 }
@@ -239,12 +239,12 @@ func (pm *PackageManager) loadPlatform(targetPackage *cores.Package, architectur
239239 release := platform .GetOrCreateRelease (version )
240240 release .IsIDEBundled = isIDEBundled
241241 if isIDEBundled {
242- pm .Log .Infof ("Package is built-in" )
242+ pm .log .Infof ("Package is built-in" )
243243 }
244244 if err := pm .loadPlatformRelease (release , platformPath ); err != nil {
245245 return fmt .Errorf ("%s: %w" , tr ("loading platform release %s" , release ), err )
246246 }
247- pm .Log .WithField ("platform" , release ).Infof ("Loaded platform" )
247+ pm .log .WithField ("platform" , release ).Infof ("Loaded platform" )
248248
249249 } else {
250250 // case: ARCHITECTURE/VERSION/boards.txt
@@ -272,7 +272,7 @@ func (pm *PackageManager) loadPlatform(targetPackage *cores.Package, architectur
272272 if err := pm .loadPlatformRelease (release , versionDir ); err != nil {
273273 return fmt .Errorf ("%s: %w" , tr ("loading platform release %s" , release ), err )
274274 }
275- pm .Log .WithField ("platform" , release ).Infof ("Loaded platform" )
275+ pm .log .WithField ("platform" , release ).Infof ("Loaded platform" )
276276 }
277277 }
278278
@@ -357,7 +357,7 @@ func (pm *PackageManager) loadPlatformRelease(platform *cores.PlatformRelease, p
357357 if len (split ) != 2 {
358358 return fmt .Errorf (tr ("invalid pluggable monitor reference: %s" ), ref )
359359 }
360- pm .Log .WithField ("protocol" , protocol ).WithField ("tool" , ref ).Info ("Adding monitor tool" )
360+ pm .log .WithField ("protocol" , protocol ).WithField ("tool" , ref ).Info ("Adding monitor tool" )
361361 platform .Monitors [protocol ] = & cores.MonitorDependency {
362362 Packager : split [0 ],
363363 Name : split [1 ],
@@ -367,7 +367,7 @@ func (pm *PackageManager) loadPlatformRelease(platform *cores.PlatformRelease, p
367367 // Support for pluggable monitors in debugging/development environments
368368 platform .MonitorsDevRecipes = map [string ]string {}
369369 for protocol , recipe := range platform .Properties .SubTree ("pluggable_monitor.pattern" ).AsMap () {
370- pm .Log .WithField ("protocol" , protocol ).WithField ("recipe" , recipe ).Info ("Adding monitor recipe" )
370+ pm .log .WithField ("protocol" , protocol ).WithField ("recipe" , recipe ).Info ("Adding monitor recipe" )
371371 platform .MonitorsDevRecipes [protocol ] = recipe
372372 }
373373
@@ -592,7 +592,7 @@ func convertUploadToolsToPluggableDiscovery(props *properties.Map) {
592592// LoadToolsFromPackageDir loads a set of tools from the given toolsPath. The tools will be loaded
593593// in the given *Package.
594594func (pm * PackageManager ) LoadToolsFromPackageDir (targetPackage * cores.Package , toolsPath * paths.Path ) []error {
595- pm .Log .Infof ("Loading tools from dir: %s" , toolsPath )
595+ pm .log .Infof ("Loading tools from dir: %s" , toolsPath )
596596
597597 var merr []error
598598
@@ -637,7 +637,7 @@ func (pm *PackageManager) loadToolReleaseFromDirectory(tool *cores.Tool, version
637637 } else {
638638 toolRelease := tool .GetOrCreateRelease (version )
639639 toolRelease .InstallDir = absToolReleasePath
640- pm .Log .WithField ("tool" , toolRelease ).Infof ("Loaded tool" )
640+ pm .log .WithField ("tool" , toolRelease ).Infof ("Loaded tool" )
641641 return nil
642642 }
643643}
@@ -655,7 +655,7 @@ func (pm *PackageManager) LoadToolsFromBundleDirectories(dirs paths.PathList) []
655655
656656// LoadToolsFromBundleDirectory FIXMEDOC
657657func (pm * PackageManager ) LoadToolsFromBundleDirectory (toolsPath * paths.Path ) error {
658- pm .Log .Infof ("Loading tools from bundle dir: %s" , toolsPath )
658+ pm .log .Infof ("Loading tools from bundle dir: %s" , toolsPath )
659659
660660 // We scan toolsPath content to find a "builtin_tools_versions.txt", if such file exists
661661 // then the all the tools are available in the same directory, mixed together, and their
@@ -689,7 +689,7 @@ func (pm *PackageManager) LoadToolsFromBundleDirectory(toolsPath *paths.Path) er
689689 if builtinToolsVersionsTxtPath != "" {
690690 // If builtin_tools_versions.txt is found create tools based on the info
691691 // contained in that file
692- pm .Log .Infof ("Found builtin_tools_versions.txt" )
692+ pm .log .Infof ("Found builtin_tools_versions.txt" )
693693 toolPath , err := paths .New (builtinToolsVersionsTxtPath ).Parent ().Abs ()
694694 if err != nil {
695695 return fmt .Errorf (tr ("getting parent dir of %[1]s: %[2]s" ), builtinToolsVersionsTxtPath , err )
@@ -708,7 +708,7 @@ func (pm *PackageManager) LoadToolsFromBundleDirectory(toolsPath *paths.Path) er
708708 version := semver .ParseRelaxed (toolVersion )
709709 release := tool .GetOrCreateRelease (version )
710710 release .InstallDir = toolPath
711- pm .Log .WithField ("tool" , release ).Infof ("Loaded tool" )
711+ pm .log .WithField ("tool" , release ).Infof ("Loaded tool" )
712712 }
713713 }
714714 } else {
0 commit comments