Skip to content

Commit 7e2194b

Browse files
committed
add logging
1 parent 242ca57 commit 7e2194b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cli/arguments/reference.go

+5
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)