@@ -55,7 +55,7 @@ func (pm *PackageManager) LoadHardwareFromDirectories(hardwarePaths paths.PathLi
55
55
// LoadHardwareFromDirectory read a plaform from the path passed as parameter
56
56
func (pm * PackageManager ) LoadHardwareFromDirectory (path * paths.Path ) []error {
57
57
var merr []error
58
- pm .Log .Infof ("Loading hardware from: %s" , path )
58
+ pm .log .Infof ("Loading hardware from: %s" , path )
59
59
if err := path .ToAbs (); err != nil {
60
60
return append (merr , fmt .Errorf ("%s: %w" , tr ("finding absolute path of %s" , path ), err ))
61
61
}
@@ -76,9 +76,9 @@ func (pm *PackageManager) LoadHardwareFromDirectory(path *paths.Path) []error {
76
76
// "Global" platform.txt used to overwrite all installed platforms.
77
77
// For more info: https://arduino.github.io/arduino-cli/latest/platform-specification/#global-platformtxt
78
78
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 )
80
80
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." )
82
82
} else {
83
83
pm .CustomGlobalProperties .Merge (p )
84
84
}
@@ -89,7 +89,7 @@ func (pm *PackageManager) LoadHardwareFromDirectory(path *paths.Path) []error {
89
89
90
90
// Skip tools, they're not packages and don't contain Platforms
91
91
if packager == "tools" {
92
- pm .Log .Infof ("Excluding directory: %s" , packagerPath )
92
+ pm .log .Infof ("Excluding directory: %s" , packagerPath )
93
93
continue
94
94
}
95
95
@@ -127,7 +127,7 @@ func (pm *PackageManager) LoadHardwareFromDirectory(path *paths.Path) []error {
127
127
// - PACKAGER/tools/TOOL-NAME/TOOL-VERSION/... (ex: arduino/tools/bossac/1.7.0/...)
128
128
toolsSubdirPath := packagerPath .Join ("tools" )
129
129
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 )
131
131
merr = append (merr , pm .LoadToolsFromPackageDir (targetPackage , toolsSubdirPath )... )
132
132
}
133
133
// 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 {
143
143
// to the targetPackage object passed as parameter.
144
144
// A list of gRPC Status error is returned for each Platform failed to load.
145
145
func (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 )
147
147
148
148
var merr []error
149
149
@@ -220,11 +220,11 @@ func (pm *PackageManager) loadPlatform(targetPackage *cores.Package, architectur
220
220
tmp := cores .NewPackages ()
221
221
index .MergeIntoPackages (tmp )
222
222
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 )
224
224
} 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 )
226
226
} 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 )
228
228
} else {
229
229
version = tmpPlatformRelease .Version
230
230
}
@@ -239,12 +239,12 @@ func (pm *PackageManager) loadPlatform(targetPackage *cores.Package, architectur
239
239
release := platform .GetOrCreateRelease (version )
240
240
release .IsIDEBundled = isIDEBundled
241
241
if isIDEBundled {
242
- pm .Log .Infof ("Package is built-in" )
242
+ pm .log .Infof ("Package is built-in" )
243
243
}
244
244
if err := pm .loadPlatformRelease (release , platformPath ); err != nil {
245
245
return fmt .Errorf ("%s: %w" , tr ("loading platform release %s" , release ), err )
246
246
}
247
- pm .Log .WithField ("platform" , release ).Infof ("Loaded platform" )
247
+ pm .log .WithField ("platform" , release ).Infof ("Loaded platform" )
248
248
249
249
} else {
250
250
// case: ARCHITECTURE/VERSION/boards.txt
@@ -272,7 +272,7 @@ func (pm *PackageManager) loadPlatform(targetPackage *cores.Package, architectur
272
272
if err := pm .loadPlatformRelease (release , versionDir ); err != nil {
273
273
return fmt .Errorf ("%s: %w" , tr ("loading platform release %s" , release ), err )
274
274
}
275
- pm .Log .WithField ("platform" , release ).Infof ("Loaded platform" )
275
+ pm .log .WithField ("platform" , release ).Infof ("Loaded platform" )
276
276
}
277
277
}
278
278
@@ -357,7 +357,7 @@ func (pm *PackageManager) loadPlatformRelease(platform *cores.PlatformRelease, p
357
357
if len (split ) != 2 {
358
358
return fmt .Errorf (tr ("invalid pluggable monitor reference: %s" ), ref )
359
359
}
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" )
361
361
platform .Monitors [protocol ] = & cores.MonitorDependency {
362
362
Packager : split [0 ],
363
363
Name : split [1 ],
@@ -367,7 +367,7 @@ func (pm *PackageManager) loadPlatformRelease(platform *cores.PlatformRelease, p
367
367
// Support for pluggable monitors in debugging/development environments
368
368
platform .MonitorsDevRecipes = map [string ]string {}
369
369
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" )
371
371
platform .MonitorsDevRecipes [protocol ] = recipe
372
372
}
373
373
@@ -592,7 +592,7 @@ func convertUploadToolsToPluggableDiscovery(props *properties.Map) {
592
592
// LoadToolsFromPackageDir loads a set of tools from the given toolsPath. The tools will be loaded
593
593
// in the given *Package.
594
594
func (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 )
596
596
597
597
var merr []error
598
598
@@ -637,7 +637,7 @@ func (pm *PackageManager) loadToolReleaseFromDirectory(tool *cores.Tool, version
637
637
} else {
638
638
toolRelease := tool .GetOrCreateRelease (version )
639
639
toolRelease .InstallDir = absToolReleasePath
640
- pm .Log .WithField ("tool" , toolRelease ).Infof ("Loaded tool" )
640
+ pm .log .WithField ("tool" , toolRelease ).Infof ("Loaded tool" )
641
641
return nil
642
642
}
643
643
}
@@ -655,7 +655,7 @@ func (pm *PackageManager) LoadToolsFromBundleDirectories(dirs paths.PathList) []
655
655
656
656
// LoadToolsFromBundleDirectory FIXMEDOC
657
657
func (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 )
659
659
660
660
// We scan toolsPath content to find a "builtin_tools_versions.txt", if such file exists
661
661
// 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
689
689
if builtinToolsVersionsTxtPath != "" {
690
690
// If builtin_tools_versions.txt is found create tools based on the info
691
691
// contained in that file
692
- pm .Log .Infof ("Found builtin_tools_versions.txt" )
692
+ pm .log .Infof ("Found builtin_tools_versions.txt" )
693
693
toolPath , err := paths .New (builtinToolsVersionsTxtPath ).Parent ().Abs ()
694
694
if err != nil {
695
695
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
708
708
version := semver .ParseRelaxed (toolVersion )
709
709
release := tool .GetOrCreateRelease (version )
710
710
release .InstallDir = toolPath
711
- pm .Log .WithField ("tool" , release ).Infof ("Loaded tool" )
711
+ pm .log .WithField ("tool" , release ).Infof ("Loaded tool" )
712
712
}
713
713
}
714
714
} else {
0 commit comments