Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d911256

Browse files
committed
add logging
1 parent 0da0a79 commit d911256

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎cli/arguments/reference.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/arduino/arduino-cli/cli/instance"
2323
"github.com/arduino/arduino-cli/commands/core"
2424
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
25+
"github.com/sirupsen/logrus"
2526
)
2627

2728
// Reference represents a reference item (core or library) passed to the CLI
@@ -55,6 +56,7 @@ func ParseReferences(args []string) ([]*Reference, error) {
5556

5657
// ParseReference parses a string and returns a Reference object.
5758
func ParseReference(arg string) (*Reference, error) {
59+
logrus.Infof("Parsing reference %s", arg)
5860
ret := &Reference{}
5961
if arg == "" {
6062
return nil, fmt.Errorf(tr("invalid empty core argument"))
@@ -95,6 +97,7 @@ func ParseReference(arg string) (*Reference, error) {
9597
var found = 0
9698
for _, platform := range platforms {
9799
if strings.EqualFold(platform.GetId(), ret.PackageName+":"+ret.Architecture) {
100+
logrus.Infof("Found possible match for reference %s -> %s", arg, platform.GetId())
98101
toks = strings.Split(platform.GetId(), ":")
99102
found++
100103
}
@@ -103,6 +106,8 @@ func ParseReference(arg string) (*Reference, error) {
103106
if found == 1 {
104107
ret.PackageName = toks[0]
105108
ret.Architecture = toks[1]
109+
} else {
110+
logrus.Warnf("Found %d platform for reference: %s", found, arg)
106111
}
107112
return ret, nil
108113
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /