Commit c316b386 authored by Umberto Baldi's avatar Umberto Baldi

added info logging in every command for consistency

parent e642f729
...@@ -27,6 +27,7 @@ import ( ...@@ -27,6 +27,7 @@ import (
"github.com/arduino/arduino-cli/cli/output" "github.com/arduino/arduino-cli/cli/output"
"github.com/arduino/arduino-cli/commands/board" "github.com/arduino/arduino-cli/commands/board"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -51,6 +52,8 @@ func initAttachCommand() *cobra.Command { ...@@ -51,6 +52,8 @@ func initAttachCommand() *cobra.Command {
func runAttachCommand(cmd *cobra.Command, args []string) { func runAttachCommand(cmd *cobra.Command, args []string) {
instance := instance.CreateAndInit() instance := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli board attach`")
path := "" path := ""
if len(args) > 1 { if len(args) > 1 {
path = args[1] path = args[1]
......
...@@ -28,6 +28,7 @@ import ( ...@@ -28,6 +28,7 @@ import (
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/arduino-cli/table" "github.com/arduino/arduino-cli/table"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -58,6 +59,8 @@ func initDetailsCommand() *cobra.Command { ...@@ -58,6 +59,8 @@ func initDetailsCommand() *cobra.Command {
func runDetailsCommand(cmd *cobra.Command, args []string) { func runDetailsCommand(cmd *cobra.Command, args []string) {
inst := instance.CreateAndInit() inst := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli board details`")
// remove once `board details <fqbn>` is removed // remove once `board details <fqbn>` is removed
if fqbn.String() == "" && len(args) > 0 { if fqbn.String() == "" && len(args) > 0 {
fqbn.Set(args[0]) fqbn.Set(args[0])
......
...@@ -28,6 +28,7 @@ import ( ...@@ -28,6 +28,7 @@ import (
"github.com/arduino/arduino-cli/commands/board" "github.com/arduino/arduino-cli/commands/board"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/arduino-cli/table" "github.com/arduino/arduino-cli/table"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -57,6 +58,9 @@ func initListCommand() *cobra.Command { ...@@ -57,6 +58,9 @@ func initListCommand() *cobra.Command {
// runListCommand detects and lists the connected arduino boards // runListCommand detects and lists the connected arduino boards
func runListCommand(cmd *cobra.Command, args []string) { func runListCommand(cmd *cobra.Command, args []string) {
inst := instance.CreateAndInit() inst := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli board list`")
if watch { if watch {
watchList(cmd, inst) watchList(cmd, inst)
os.Exit(0) os.Exit(0)
......
...@@ -27,6 +27,7 @@ import ( ...@@ -27,6 +27,7 @@ import (
"github.com/arduino/arduino-cli/commands/board" "github.com/arduino/arduino-cli/commands/board"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/arduino-cli/table" "github.com/arduino/arduino-cli/table"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -52,6 +53,8 @@ for a specific board if you specify the board name`), ...@@ -52,6 +53,8 @@ for a specific board if you specify the board name`),
func runListAllCommand(cmd *cobra.Command, args []string) { func runListAllCommand(cmd *cobra.Command, args []string) {
inst := instance.CreateAndInit() inst := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli board listall`")
list, err := board.ListAll(context.Background(), &rpc.BoardListAllRequest{ list, err := board.ListAll(context.Background(), &rpc.BoardListAllRequest{
Instance: inst, Instance: inst,
SearchArgs: args, SearchArgs: args,
......
...@@ -28,6 +28,7 @@ import ( ...@@ -28,6 +28,7 @@ import (
"github.com/arduino/arduino-cli/commands/board" "github.com/arduino/arduino-cli/commands/board"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/arduino-cli/table" "github.com/arduino/arduino-cli/table"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -50,6 +51,8 @@ for a specific board if you specify the board name`), ...@@ -50,6 +51,8 @@ for a specific board if you specify the board name`),
func runSearchCommand(cmd *cobra.Command, args []string) { func runSearchCommand(cmd *cobra.Command, args []string) {
inst := instance.CreateAndInit() inst := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli board search`")
res, err := board.Search(context.Background(), &rpc.BoardSearchRequest{ res, err := board.Search(context.Background(), &rpc.BoardSearchRequest{
Instance: inst, Instance: inst,
SearchArgs: strings.Join(args, " "), SearchArgs: strings.Join(args, " "),
......
...@@ -26,6 +26,7 @@ import ( ...@@ -26,6 +26,7 @@ import (
"github.com/arduino/arduino-cli/commands/upload" "github.com/arduino/arduino-cli/commands/upload"
"github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/i18n"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -64,6 +65,8 @@ func NewCommand() *cobra.Command { ...@@ -64,6 +65,8 @@ func NewCommand() *cobra.Command {
func runBootloaderCommand(command *cobra.Command, args []string) { func runBootloaderCommand(command *cobra.Command, args []string) {
instance := instance.CreateAndInit() instance := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli burn-bootloader`")
// We don't need a Sketch to upload a board's bootloader // We don't need a Sketch to upload a board's bootloader
discoveryPort, err := port.GetPort(instance, nil) discoveryPort, err := port.GetPort(instance, nil)
if err != nil { if err != nil {
......
...@@ -38,7 +38,7 @@ func initCleanCommand() *cobra.Command { ...@@ -38,7 +38,7 @@ func initCleanCommand() *cobra.Command {
} }
func runCleanCommand(cmd *cobra.Command, args []string) { func runCleanCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino cache clean`") logrus.Info("Executing `arduino-cli cache clean`")
cachePath := configuration.Settings.GetString("directories.Downloads") cachePath := configuration.Settings.GetString("directories.Downloads")
err := os.RemoveAll(cachePath) err := os.RemoveAll(cachePath)
......
...@@ -26,6 +26,7 @@ import ( ...@@ -26,6 +26,7 @@ import (
"github.com/arduino/arduino-cli/cli/output" "github.com/arduino/arduino-cli/cli/output"
"github.com/arduino/arduino-cli/configuration" "github.com/arduino/arduino-cli/configuration"
"github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/i18n"
"github.com/sirupsen/logrus"
"github.com/arduino/arduino-cli/cli/errorcodes" "github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/instance" "github.com/arduino/arduino-cli/cli/instance"
...@@ -123,6 +124,8 @@ func NewCommand() *cobra.Command { ...@@ -123,6 +124,8 @@ func NewCommand() *cobra.Command {
func runCompileCommand(cmd *cobra.Command, args []string) { func runCompileCommand(cmd *cobra.Command, args []string) {
inst := instance.CreateAndInit() inst := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli compile`")
path := "" path := ""
if len(args) > 0 { if len(args) > 0 {
path = args[0] path = args[0]
......
...@@ -21,6 +21,7 @@ import ( ...@@ -21,6 +21,7 @@ import (
"github.com/arduino/arduino-cli/cli/errorcodes" "github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback" "github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/i18n"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -47,6 +48,7 @@ func NewCommand() *cobra.Command { ...@@ -47,6 +48,7 @@ func NewCommand() *cobra.Command {
} }
func runCompletionCommand(cmd *cobra.Command, args []string) { func runCompletionCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino-cli completion`")
if completionNoDesc && (args[0] == "powershell") { if completionNoDesc && (args[0] == "powershell") {
feedback.Errorf(tr("Error: command description is not supported by %v"), args[0]) feedback.Errorf(tr("Error: command description is not supported by %v"), args[0])
os.Exit(errorcodes.ErrGeneric) os.Exit(errorcodes.ErrGeneric)
......
...@@ -22,6 +22,7 @@ import ( ...@@ -22,6 +22,7 @@ import (
"github.com/arduino/arduino-cli/cli/errorcodes" "github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback" "github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-cli/configuration" "github.com/arduino/arduino-cli/configuration"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -43,6 +44,7 @@ func initAddCommand() *cobra.Command { ...@@ -43,6 +44,7 @@ func initAddCommand() *cobra.Command {
} }
func runAddCommand(cmd *cobra.Command, args []string) { func runAddCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino-cli config add`")
key := args[0] key := args[0]
kind := validateKey(key) kind := validateKey(key)
......
...@@ -22,6 +22,7 @@ import ( ...@@ -22,6 +22,7 @@ import (
"github.com/arduino/arduino-cli/cli/errorcodes" "github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback" "github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-cli/configuration" "github.com/arduino/arduino-cli/configuration"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
) )
...@@ -44,6 +45,7 @@ func initDeleteCommand() *cobra.Command { ...@@ -44,6 +45,7 @@ func initDeleteCommand() *cobra.Command {
} }
func runDeleteCommand(cmd *cobra.Command, args []string) { func runDeleteCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino-cli config delete`")
toDelete := args[0] toDelete := args[0]
keys := []string{} keys := []string{}
......
...@@ -38,7 +38,7 @@ func initDumpCommand() *cobra.Command { ...@@ -38,7 +38,7 @@ func initDumpCommand() *cobra.Command {
} }
func runDumpCommand(cmd *cobra.Command, args []string) { func runDumpCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino config dump`") logrus.Info("Executing `arduino-cli config dump`")
feedback.PrintResult(dumpResult{configuration.Settings.AllSettings()}) feedback.PrintResult(dumpResult{configuration.Settings.AllSettings()})
} }
......
...@@ -59,6 +59,7 @@ func initInitCommand() *cobra.Command { ...@@ -59,6 +59,7 @@ func initInitCommand() *cobra.Command {
} }
func runInitCommand(cmd *cobra.Command, args []string) { func runInitCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino-cli config init`")
var configFileAbsPath *paths.Path var configFileAbsPath *paths.Path
var absPath *paths.Path var absPath *paths.Path
......
...@@ -22,6 +22,7 @@ import ( ...@@ -22,6 +22,7 @@ import (
"github.com/arduino/arduino-cli/cli/errorcodes" "github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback" "github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-cli/configuration" "github.com/arduino/arduino-cli/configuration"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -43,6 +44,7 @@ func initRemoveCommand() *cobra.Command { ...@@ -43,6 +44,7 @@ func initRemoveCommand() *cobra.Command {
} }
func runRemoveCommand(cmd *cobra.Command, args []string) { func runRemoveCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino-cli config remove`")
key := args[0] key := args[0]
kind := validateKey(key) kind := validateKey(key)
......
...@@ -23,6 +23,7 @@ import ( ...@@ -23,6 +23,7 @@ import (
"github.com/arduino/arduino-cli/cli/errorcodes" "github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback" "github.com/arduino/arduino-cli/cli/feedback"
"github.com/arduino/arduino-cli/configuration" "github.com/arduino/arduino-cli/configuration"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -46,6 +47,7 @@ func initSetCommand() *cobra.Command { ...@@ -46,6 +47,7 @@ func initSetCommand() *cobra.Command {
} }
func runSetCommand(cmd *cobra.Command, args []string) { func runSetCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino-cli config set`")
key := args[0] key := args[0]
kind := validateKey(key) kind := validateKey(key)
......
...@@ -51,7 +51,7 @@ func initDownloadCommand() *cobra.Command { ...@@ -51,7 +51,7 @@ func initDownloadCommand() *cobra.Command {
func runDownloadCommand(cmd *cobra.Command, args []string) { func runDownloadCommand(cmd *cobra.Command, args []string) {
inst := instance.CreateAndInit() inst := instance.CreateAndInit()
logrus.Info("Executing `arduino core download`") logrus.Info("Executing `arduino-cli core download`")
platformsRefs, err := arguments.ParseReferences(args, true) platformsRefs, err := arguments.ParseReferences(args, true)
if err != nil { if err != nil {
......
...@@ -59,7 +59,7 @@ func initInstallCommand() *cobra.Command { ...@@ -59,7 +59,7 @@ func initInstallCommand() *cobra.Command {
func runInstallCommand(cmd *cobra.Command, args []string) { func runInstallCommand(cmd *cobra.Command, args []string) {
inst := instance.CreateAndInit() inst := instance.CreateAndInit()
logrus.Info("Executing `arduino core install`") logrus.Info("Executing `arduino-cli core install`")
platformsRefs, err := arguments.ParseReferences(args, true) platformsRefs, err := arguments.ParseReferences(args, true)
if err != nil { if err != nil {
......
...@@ -50,7 +50,7 @@ func initListCommand() *cobra.Command { ...@@ -50,7 +50,7 @@ func initListCommand() *cobra.Command {
func runListCommand(cmd *cobra.Command, args []string) { func runListCommand(cmd *cobra.Command, args []string) {
inst := instance.CreateAndInit() inst := instance.CreateAndInit()
logrus.Info("Executing `arduino core list`") logrus.Info("Executing `arduino-cli core list`")
platforms, err := core.GetPlatforms(&rpc.PlatformListRequest{ platforms, err := core.GetPlatforms(&rpc.PlatformListRequest{
Instance: inst, Instance: inst,
......
...@@ -82,7 +82,7 @@ func runSearchCommand(cmd *cobra.Command, args []string) { ...@@ -82,7 +82,7 @@ func runSearchCommand(cmd *cobra.Command, args []string) {
} }
arguments := strings.ToLower(strings.Join(args, " ")) arguments := strings.ToLower(strings.Join(args, " "))
logrus.Infof("Executing `arduino core search` with args: '%s'", arguments) logrus.Infof("Executing `arduino-cli core search` with args: '%s'", arguments)
resp, err := core.PlatformSearch(&rpc.PlatformSearchRequest{ resp, err := core.PlatformSearch(&rpc.PlatformSearchRequest{
Instance: inst, Instance: inst,
......
...@@ -48,7 +48,7 @@ func initUninstallCommand() *cobra.Command { ...@@ -48,7 +48,7 @@ func initUninstallCommand() *cobra.Command {
func runUninstallCommand(cmd *cobra.Command, args []string) { func runUninstallCommand(cmd *cobra.Command, args []string) {
inst := instance.CreateAndInit() inst := instance.CreateAndInit()
logrus.Info("Executing `arduino core uninstall`") logrus.Info("Executing `arduino-cli core uninstall`")
platformsRefs, err := arguments.ParseReferences(args, true) platformsRefs, err := arguments.ParseReferences(args, true)
if err != nil { if err != nil {
......
...@@ -42,8 +42,8 @@ func initUpdateIndexCommand() *cobra.Command { ...@@ -42,8 +42,8 @@ func initUpdateIndexCommand() *cobra.Command {
} }
func runUpdateIndexCommand(cmd *cobra.Command, args []string) { func runUpdateIndexCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino core update-index`")
inst := instance.CreateInstanceAndRunFirstUpdate() inst := instance.CreateInstanceAndRunFirstUpdate()
logrus.Info("Executing `arduino-cli core update-index`")
_, err := commands.UpdateIndex(context.Background(), &rpc.UpdateIndexRequest{ _, err := commands.UpdateIndex(context.Background(), &rpc.UpdateIndexRequest{
Instance: inst, Instance: inst,
......
...@@ -51,7 +51,7 @@ func initUpgradeCommand() *cobra.Command { ...@@ -51,7 +51,7 @@ func initUpgradeCommand() *cobra.Command {
func runUpgradeCommand(cmd *cobra.Command, args []string) { func runUpgradeCommand(cmd *cobra.Command, args []string) {
inst := instance.CreateAndInit() inst := instance.CreateAndInit()
logrus.Info("Executing `arduino core upgrade`") logrus.Info("Executing `arduino-cli core upgrade`")
// if no platform was passed, upgrade allthethings // if no platform was passed, upgrade allthethings
if len(args) == 0 { if len(args) == 0 {
......
...@@ -67,6 +67,7 @@ func NewCommand() *cobra.Command { ...@@ -67,6 +67,7 @@ func NewCommand() *cobra.Command {
} }
func runDaemonCommand(cmd *cobra.Command, args []string) { func runDaemonCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino-cli daemon`")
if configuration.Settings.GetBool("metrics.enabled") { if configuration.Settings.GetBool("metrics.enabled") {
metrics.Activate("daemon") metrics.Activate("daemon")
......
...@@ -31,6 +31,7 @@ import ( ...@@ -31,6 +31,7 @@ import (
"github.com/arduino/arduino-cli/table" "github.com/arduino/arduino-cli/table"
"github.com/arduino/go-properties-orderedmap" "github.com/arduino/go-properties-orderedmap"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -67,6 +68,7 @@ func NewCommand() *cobra.Command { ...@@ -67,6 +68,7 @@ func NewCommand() *cobra.Command {
func runDebugCommand(command *cobra.Command, args []string) { func runDebugCommand(command *cobra.Command, args []string) {
instance := instance.CreateAndInit() instance := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli debug`")
path := "" path := ""
if len(args) > 0 { if len(args) > 0 {
......
...@@ -58,6 +58,7 @@ func NewCommand() *cobra.Command { ...@@ -58,6 +58,7 @@ func NewCommand() *cobra.Command {
} }
func generateBashCompletions(cmd *cobra.Command, args []string) { func generateBashCompletions(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino-cli generate-docs`")
if outputDir == "" { if outputDir == "" {
outputDir = "docs/bash_completions" outputDir = "docs/bash_completions"
} }
......
...@@ -27,6 +27,7 @@ import ( ...@@ -27,6 +27,7 @@ import (
"github.com/arduino/arduino-cli/commands/lib" "github.com/arduino/arduino-cli/commands/lib"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -49,6 +50,7 @@ func initDepsCommand() *cobra.Command { ...@@ -49,6 +50,7 @@ func initDepsCommand() *cobra.Command {
func runDepsCommand(cmd *cobra.Command, args []string) { func runDepsCommand(cmd *cobra.Command, args []string) {
instance := instance.CreateAndInit() instance := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli lib deps`")
libRef, err := ParseLibraryReferenceArgAndAdjustCase(instance, args[0]) libRef, err := ParseLibraryReferenceArgAndAdjustCase(instance, args[0])
if err != nil { if err != nil {
feedback.Errorf(tr("Arguments error: %v"), err) feedback.Errorf(tr("Arguments error: %v"), err)
......
...@@ -27,6 +27,7 @@ import ( ...@@ -27,6 +27,7 @@ import (
"github.com/arduino/arduino-cli/cli/output" "github.com/arduino/arduino-cli/cli/output"
"github.com/arduino/arduino-cli/commands/lib" "github.com/arduino/arduino-cli/commands/lib"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -49,6 +50,7 @@ func initDownloadCommand() *cobra.Command { ...@@ -49,6 +50,7 @@ func initDownloadCommand() *cobra.Command {
func runDownloadCommand(cmd *cobra.Command, args []string) { func runDownloadCommand(cmd *cobra.Command, args []string) {
instance := instance.CreateAndInit() instance := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli lib download`")
refs, err := ParseLibraryReferenceArgsAndAdjustCase(instance, args) refs, err := ParseLibraryReferenceArgsAndAdjustCase(instance, args)
if err != nil { if err != nil {
feedback.Errorf(tr("Invalid argument passed: %v"), err) feedback.Errorf(tr("Invalid argument passed: %v"), err)
......
...@@ -56,7 +56,7 @@ func initExamplesCommand() *cobra.Command { ...@@ -56,7 +56,7 @@ func initExamplesCommand() *cobra.Command {
func runExamplesCommand(cmd *cobra.Command, args []string) { func runExamplesCommand(cmd *cobra.Command, args []string) {
instance := instance.CreateAndInit() instance := instance.CreateAndInit()
logrus.Info("Show examples for library") logrus.Info("Executing `arduino-cli lib examples`")
name := "" name := ""
if len(args) > 0 { if len(args) > 0 {
......
...@@ -31,6 +31,7 @@ import ( ...@@ -31,6 +31,7 @@ import (
"github.com/arduino/arduino-cli/configuration" "github.com/arduino/arduino-cli/configuration"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/go-paths-helper" "github.com/arduino/go-paths-helper"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
semver "go.bug.st/relaxed-semver" semver "go.bug.st/relaxed-semver"
) )
...@@ -65,6 +66,7 @@ func initInstallCommand() *cobra.Command { ...@@ -65,6 +66,7 @@ func initInstallCommand() *cobra.Command {
func runInstallCommand(cmd *cobra.Command, args []string) { func runInstallCommand(cmd *cobra.Command, args []string) {
instance := instance.CreateAndInit() instance := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli lib install`")
if zipPath || gitURL { if zipPath || gitURL {
if !configuration.Settings.GetBool("library.enable_unsafe_install") { if !configuration.Settings.GetBool("library.enable_unsafe_install") {
......
...@@ -58,7 +58,7 @@ not listed, they can be listed by adding the --all flag.`), ...@@ -58,7 +58,7 @@ not listed, they can be listed by adding the --all flag.`),
func runListCommand(cmd *cobra.Command, args []string) { func runListCommand(cmd *cobra.Command, args []string) {
instance := instance.CreateAndInit() instance := instance.CreateAndInit()
logrus.Info("Listing") logrus.Info("Executing `arduino-cli lib list`")
name := "" name := ""
if len(args) > 0 { if len(args) > 0 {
......
...@@ -53,6 +53,8 @@ func initSearchCommand() *cobra.Command { ...@@ -53,6 +53,8 @@ func initSearchCommand() *cobra.Command {
func runSearchCommand(cmd *cobra.Command, args []string) { func runSearchCommand(cmd *cobra.Command, args []string) {
inst, status := instance.Create() inst, status := instance.Create()
logrus.Info("Executing `arduino-cli lib search`")
if status != nil { if status != nil {
feedback.Errorf(tr("Error creating instance: %v"), status) feedback.Errorf(tr("Error creating instance: %v"), status)
os.Exit(errorcodes.ErrGeneric) os.Exit(errorcodes.ErrGeneric)
...@@ -71,7 +73,6 @@ func runSearchCommand(cmd *cobra.Command, args []string) { ...@@ -71,7 +73,6 @@ func runSearchCommand(cmd *cobra.Command, args []string) {
feedback.Errorf(tr("Error initializing instance: %v"), err) feedback.Errorf(tr("Error initializing instance: %v"), err)
} }
logrus.Info("Executing `arduino lib search`")
searchResp, err := lib.LibrarySearch(context.Background(), &rpc.LibrarySearchRequest{ searchResp, err := lib.LibrarySearch(context.Background(), &rpc.LibrarySearchRequest{
Instance: inst, Instance: inst,
Query: (strings.Join(args, " ")), Query: (strings.Join(args, " ")),
......
...@@ -47,9 +47,9 @@ func initUninstallCommand() *cobra.Command { ...@@ -47,9 +47,9 @@ func initUninstallCommand() *cobra.Command {
} }
func runUninstallCommand(cmd *cobra.Command, args []string) { func runUninstallCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino lib uninstall`")
instance := instance.CreateAndInit() instance := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli lib uninstall`")
refs, err := ParseLibraryReferenceArgsAndAdjustCase(instance, args) refs, err := ParseLibraryReferenceArgsAndAdjustCase(instance, args)
if err != nil { if err != nil {
feedback.Errorf(tr("Invalid argument passed: %v"), err) feedback.Errorf(tr("Invalid argument passed: %v"), err)
......
...@@ -42,8 +42,8 @@ func initUpdateIndexCommand() *cobra.Command { ...@@ -42,8 +42,8 @@ func initUpdateIndexCommand() *cobra.Command {
} }
func runUpdateIndexCommand(cmd *cobra.Command, args []string) { func runUpdateIndexCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino lib update-index`")
inst := instance.CreateInstanceAndRunFirstUpdate() inst := instance.CreateInstanceAndRunFirstUpdate()
logrus.Info("Executing `arduino-cli lib update-index`")
err := commands.UpdateLibrariesIndex(context.Background(), &rpc.UpdateLibrariesIndexRequest{ err := commands.UpdateLibrariesIndex(context.Background(), &rpc.UpdateLibrariesIndexRequest{
Instance: inst, Instance: inst,
......
...@@ -43,6 +43,7 @@ func initUpgradeCommand() *cobra.Command { ...@@ -43,6 +43,7 @@ func initUpgradeCommand() *cobra.Command {
func runUpgradeCommand(cmd *cobra.Command, args []string) { func runUpgradeCommand(cmd *cobra.Command, args []string) {
instance := instance.CreateAndInit() instance := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli lib upgrade`")
if len(args) == 0 { if len(args) == 0 {
err := lib.LibraryUpgradeAll(instance.Id, output.ProgressBar(), output.TaskProgress()) err := lib.LibraryUpgradeAll(instance.Id, output.ProgressBar(), output.TaskProgress())
......
...@@ -34,6 +34,7 @@ import ( ...@@ -34,6 +34,7 @@ import (
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/arduino-cli/table" "github.com/arduino/arduino-cli/table"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -68,6 +69,7 @@ func NewCommand() *cobra.Command { ...@@ -68,6 +69,7 @@ func NewCommand() *cobra.Command {
func runMonitorCmd(cmd *cobra.Command, args []string) { func runMonitorCmd(cmd *cobra.Command, args []string) {
instance := instance.CreateAndInit() instance := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli monitor`")
if !configuration.HasConsole { if !configuration.HasConsole {
quiet = true quiet = true
......
...@@ -48,7 +48,7 @@ that can be upgraded. If nothing needs to be updated the output is empty.`), ...@@ -48,7 +48,7 @@ that can be upgraded. If nothing needs to be updated the output is empty.`),
func runOutdatedCommand(cmd *cobra.Command, args []string) { func runOutdatedCommand(cmd *cobra.Command, args []string) {
inst := instance.CreateAndInit() inst := instance.CreateAndInit()
logrus.Info("Executing `arduino outdated`") logrus.Info("Executing `arduino-cli outdated`")
outdatedResp, err := commands.Outdated(context.Background(), &rpc.OutdatedRequest{ outdatedResp, err := commands.Outdated(context.Background(), &rpc.OutdatedRequest{
Instance: inst, Instance: inst,
......
...@@ -54,7 +54,7 @@ func initArchiveCommand() *cobra.Command { ...@@ -54,7 +54,7 @@ func initArchiveCommand() *cobra.Command {
} }
func runArchiveCommand(cmd *cobra.Command, args []string) { func runArchiveCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino sketch archive`") logrus.Info("Executing `arduino-cli sketch archive`")
sketchPath := paths.New(".") sketchPath := paths.New(".")
if len(args) >= 1 { if len(args) >= 1 {
......
...@@ -26,6 +26,7 @@ import ( ...@@ -26,6 +26,7 @@ import (
sk "github.com/arduino/arduino-cli/commands/sketch" sk "github.com/arduino/arduino-cli/commands/sketch"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
paths "github.com/arduino/go-paths-helper" paths "github.com/arduino/go-paths-helper"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -42,6 +43,7 @@ func initNewCommand() *cobra.Command { ...@@ -42,6 +43,7 @@ func initNewCommand() *cobra.Command {
} }
func runNewCommand(cmd *cobra.Command, args []string) { func runNewCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino-cli sketch new`")
// Trim to avoid issues if user creates a sketch adding the .ino extesion to the name // Trim to avoid issues if user creates a sketch adding the .ino extesion to the name
sketchName := args[0] sketchName := args[0]
trimmedSketchName := strings.TrimSuffix(sketchName, globals.MainFileValidExtension) trimmedSketchName := strings.TrimSuffix(sketchName, globals.MainFileValidExtension)
......
...@@ -52,8 +52,8 @@ var updateFlags struct { ...@@ -52,8 +52,8 @@ var updateFlags struct {
} }
func runUpdateCommand(cmd *cobra.Command, args []string) { func runUpdateCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino update`")
inst := instance.CreateInstanceAndRunFirstUpdate() inst := instance.CreateInstanceAndRunFirstUpdate()
logrus.Info("Executing `arduino-cli update`")
err := commands.UpdateCoreLibrariesIndex(context.Background(), &rpc.UpdateCoreLibrariesIndexRequest{ err := commands.UpdateCoreLibrariesIndex(context.Background(), &rpc.UpdateCoreLibrariesIndexRequest{
Instance: inst, Instance: inst,
......
...@@ -52,7 +52,7 @@ func NewCommand() *cobra.Command { ...@@ -52,7 +52,7 @@ func NewCommand() *cobra.Command {
func runUpgradeCommand(cmd *cobra.Command, args []string) { func runUpgradeCommand(cmd *cobra.Command, args []string) {
inst := instance.CreateAndInit() inst := instance.CreateAndInit()
logrus.Info("Executing `arduino upgrade`") logrus.Info("Executing `arduino-cli upgrade`")
err := commands.Upgrade(context.Background(), &rpc.UpgradeRequest{ err := commands.Upgrade(context.Background(), &rpc.UpgradeRequest{
Instance: inst, Instance: inst,
......
...@@ -26,6 +26,7 @@ import ( ...@@ -26,6 +26,7 @@ import (
"github.com/arduino/arduino-cli/commands/upload" "github.com/arduino/arduino-cli/commands/upload"
"github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/i18n"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
...@@ -69,6 +70,7 @@ func NewCommand() *cobra.Command { ...@@ -69,6 +70,7 @@ func NewCommand() *cobra.Command {
func runUploadCommand(command *cobra.Command, args []string) { func runUploadCommand(command *cobra.Command, args []string) {
instance := instance.CreateAndInit() instance := instance.CreateAndInit()
logrus.Info("Executing `arduino-cli upload`")
path := "" path := ""
if len(args) > 0 { if len(args) > 0 {
......
...@@ -24,6 +24,7 @@ import ( ...@@ -24,6 +24,7 @@ import (
"github.com/arduino/arduino-cli/cli/globals" "github.com/arduino/arduino-cli/cli/globals"
"github.com/arduino/arduino-cli/cli/updater" "github.com/arduino/arduino-cli/cli/updater"
"github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/i18n"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
semver "go.bug.st/relaxed-semver" semver "go.bug.st/relaxed-semver"
) )
...@@ -44,6 +45,7 @@ func NewCommand() *cobra.Command { ...@@ -44,6 +45,7 @@ func NewCommand() *cobra.Command {
} }
func runVersionCommand(cmd *cobra.Command, args []string) { func runVersionCommand(cmd *cobra.Command, args []string) {
logrus.Info("Executing `arduino-cli version`")
if strings.Contains(globals.VersionInfo.VersionString, "git-snapshot") || strings.Contains(globals.VersionInfo.VersionString, "nightly") { if strings.Contains(globals.VersionInfo.VersionString, "git-snapshot") || strings.Contains(globals.VersionInfo.VersionString, "nightly") {
// We're using a development version, no need to check if there's a // We're using a development version, no need to check if there's a
// new release available // new release available
......
...@@ -31,7 +31,7 @@ var tr = i18n.Tr ...@@ -31,7 +31,7 @@ var tr = i18n.Tr
// LibraryDownload FIXMEDOC // LibraryDownload FIXMEDOC
func LibraryDownload(ctx context.Context, req *rpc.LibraryDownloadRequest, downloadCB commands.DownloadProgressCB) (*rpc.LibraryDownloadResponse, error) { func LibraryDownload(ctx context.Context, req *rpc.LibraryDownloadRequest, downloadCB commands.DownloadProgressCB) (*rpc.LibraryDownloadResponse, error) {
logrus.Info("Executing `arduino lib download`") logrus.Info("Executing `arduino-cli lib download`")
lm := commands.GetLibraryManager(req.GetInstance().GetId()) lm := commands.GetLibraryManager(req.GetInstance().GetId())
if lm == nil { if lm == nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment