Files
sailpoint-cli/cmd/set/debug.go
luke-hagar-sp c4c15361d6 VA Log Configuration Commands, etc...
* 🪵 Implemented an Improved Global logger solution
* 🥈 Removed duplicate APIClient inits
* 🐛 Corrected an issue with the payload for spconfig import
* 🚤 Significantly improved the Speed of Parsing log files with sail va parse
* 🎢 Improved error handling for all VA commands
* 💻 Added a VA List Command, along with Get and Set commands for VA Log Config
2023-05-16 09:01:34 -05:00

43 lines
964 B
Go

package set
import (
"strings"
"github.com/charmbracelet/log"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
func newDebugCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "debug",
Short: "Set the CLI Debug Mode",
Long: "\nSet the CLI Debug Mode, Primarily used for Logging and Troubleshooting\n\n",
Example: "sail set debug disable | sail set debug enable | sail set debug true | sail set debug false",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
switch strings.ToLower(args[0]) {
case "enable":
viper.Set("debug", true)
log.Info("Debug Enabled")
case "true":
viper.Set("debug", true)
log.Info("Debug Enabled")
case "disable":
viper.Set("debug", false)
log.Info("Debug Disabled")
case "false":
viper.Set("debug", false)
log.Info("Debug Disabled")
default:
log.Error("Invalid Selection")
}
return nil
},
}
return cmd
}