Skip to content

Commit c316b38

Browse files
committed
added info logging in every command for consistency
1 parent e642f72 commit c316b38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+73
-20
lines changed

cli/board/attach.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/arduino/arduino-cli/cli/output"
2828
"github.com/arduino/arduino-cli/commands/board"
2929
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
30+
"github.com/sirupsen/logrus"
3031
"github.com/spf13/cobra"
3132
)
3233

@@ -51,6 +52,8 @@ func initAttachCommand() *cobra.Command {
5152
func runAttachCommand(cmd *cobra.Command, args []string) {
5253
instance := instance.CreateAndInit()
5354

55+
logrus.Info("Executing `arduino-cli board attach`")
56+
5457
path := ""
5558
if len(args) > 1 {
5659
path = args[1]

cli/board/details.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
2929
"github.com/arduino/arduino-cli/table"
3030
"github.com/fatih/color"
31+
"github.com/sirupsen/logrus"
3132
"github.com/spf13/cobra"
3233
)
3334

@@ -58,6 +59,8 @@ func initDetailsCommand() *cobra.Command {
5859
func runDetailsCommand(cmd *cobra.Command, args []string) {
5960
inst := instance.CreateAndInit()
6061

62+
logrus.Info("Executing `arduino-cli board details`")
63+
6164
// remove once `board details <fqbn>` is removed
6265
if fqbn.String() == "" && len(args) > 0 {
6366
fqbn.Set(args[0])

cli/board/list.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/arduino/arduino-cli/commands/board"
2929
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
3030
"github.com/arduino/arduino-cli/table"
31+
"github.com/sirupsen/logrus"
3132
"github.com/spf13/cobra"
3233
)
3334

@@ -57,6 +58,9 @@ func initListCommand() *cobra.Command {
5758
// runListCommand detects and lists the connected arduino boards
5859
func runListCommand(cmd *cobra.Command, args []string) {
5960
inst := instance.CreateAndInit()
61+
62+
logrus.Info("Executing `arduino-cli board list`")
63+
6064
if watch {
6165
watchList(cmd, inst)
6266
os.Exit(0)

cli/board/listall.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/arduino/arduino-cli/commands/board"
2828
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
2929
"github.com/arduino/arduino-cli/table"
30+
"github.com/sirupsen/logrus"
3031
"github.com/spf13/cobra"
3132
)
3233

@@ -52,6 +53,8 @@ for a specific board if you specify the board name`),
5253
func runListAllCommand(cmd *cobra.Command, args []string) {
5354
inst := instance.CreateAndInit()
5455

56+
logrus.Info("Executing `arduino-cli board listall`")
57+
5558
list, err := board.ListAll(context.Background(), &rpc.BoardListAllRequest{
5659
Instance: inst,
5760
SearchArgs: args,

cli/board/search.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/arduino/arduino-cli/commands/board"
2929
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
3030
"github.com/arduino/arduino-cli/table"
31+
"github.com/sirupsen/logrus"
3132
"github.com/spf13/cobra"
3233
)
3334

@@ -50,6 +51,8 @@ for a specific board if you specify the board name`),
5051
func runSearchCommand(cmd *cobra.Command, args []string) {
5152
inst := instance.CreateAndInit()
5253

54+
logrus.Info("Executing `arduino-cli board search`")
55+
5356
res, err := board.Search(context.Background(), &rpc.BoardSearchRequest{
5457
Instance: inst,
5558
SearchArgs: strings.Join(args, " "),

cli/burnbootloader/burnbootloader.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"github.com/arduino/arduino-cli/commands/upload"
2727
"github.com/arduino/arduino-cli/i18n"
2828
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
29+
"github.com/sirupsen/logrus"
2930
"github.com/spf13/cobra"
3031
)
3132

@@ -64,6 +65,8 @@ func NewCommand() *cobra.Command {
6465
func runBootloaderCommand(command *cobra.Command, args []string) {
6566
instance := instance.CreateAndInit()
6667

68+
logrus.Info("Executing `arduino-cli burn-bootloader`")
69+
6770
// We don't need a Sketch to upload a board's bootloader
6871
discoveryPort, err := port.GetPort(instance, nil)
6972
if err != nil {

cli/cache/clean.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func initCleanCommand() *cobra.Command {
3838
}
3939

4040
func runCleanCommand(cmd *cobra.Command, args []string) {
41-
logrus.Info("Executing `arduino cache clean`")
41+
logrus.Info("Executing `arduino-cli cache clean`")
4242

4343
cachePath := configuration.Settings.GetString("directories.Downloads")
4444
err := os.RemoveAll(cachePath)

cli/compile/compile.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"github.com/arduino/arduino-cli/cli/output"
2727
"github.com/arduino/arduino-cli/configuration"
2828
"github.com/arduino/arduino-cli/i18n"
29+
"github.com/sirupsen/logrus"
2930

3031
"github.com/arduino/arduino-cli/cli/errorcodes"
3132
"github.com/arduino/arduino-cli/cli/instance"
@@ -123,6 +124,8 @@ func NewCommand() *cobra.Command {
123124
func runCompileCommand(cmd *cobra.Command, args []string) {
124125
inst := instance.CreateAndInit()
125126

127+
logrus.Info("Executing `arduino-cli compile`")
128+
126129
path := ""
127130
if len(args) > 0 {
128131
path = args[0]

cli/completion/completion.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"github.com/arduino/arduino-cli/cli/errorcodes"
2222
"github.com/arduino/arduino-cli/cli/feedback"
2323
"github.com/arduino/arduino-cli/i18n"
24+
"github.com/sirupsen/logrus"
2425
"github.com/spf13/cobra"
2526
)
2627

@@ -47,6 +48,7 @@ func NewCommand() *cobra.Command {
4748
}
4849

4950
func runCompletionCommand(cmd *cobra.Command, args []string) {
51+
logrus.Info("Executing `arduino-cli completion`")
5052
if completionNoDesc && (args[0] == "powershell") {
5153
feedback.Errorf(tr("Error: command description is not supported by %v"), args[0])
5254
os.Exit(errorcodes.ErrGeneric)

cli/config/add.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/arduino/arduino-cli/cli/errorcodes"
2323
"github.com/arduino/arduino-cli/cli/feedback"
2424
"github.com/arduino/arduino-cli/configuration"
25+
"github.com/sirupsen/logrus"
2526
"github.com/spf13/cobra"
2627
)
2728

@@ -43,6 +44,7 @@ func initAddCommand() *cobra.Command {
4344
}
4445

4546
func runAddCommand(cmd *cobra.Command, args []string) {
47+
logrus.Info("Executing `arduino-cli config add`")
4648
key := args[0]
4749
kind := validateKey(key)
4850

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy