Skip to content

Commit

Permalink
fix: enable debug logging for cli (#1280)
Browse files Browse the repository at this point in the history
  • Loading branch information
wtrocki authored Nov 4, 2021
1 parent ac4fb18 commit 60732f1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions cmd/rhoas/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func executeCommandWithTelemetry(rootCmd *cobra.Command, cmdFactory *factory.Fac
}
commandPath := ""
rootCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
cmdFactory.Logger.SetDebug(debug.Enabled())
if cmd.Runnable() && !cmd.Hidden {
commandPath = cmd.CommandPath()
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/cmd/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package root

import (
"github.com/redhat-developer/app-services-cli/pkg/arguments"
"github.com/redhat-developer/app-services-cli/pkg/cmd/debug"
"github.com/redhat-developer/app-services-cli/pkg/cmd/docs"

"github.com/redhat-developer/app-services-cli/pkg/cmd/registry"
Expand All @@ -29,9 +28,6 @@ func NewRootCommand(f *factory.Factory, version string) *cobra.Command {
Short: f.Localizer.MustLocalize("root.cmd.shortDescription"),
Long: f.Localizer.MustLocalize("root.cmd.longDescription"),
Example: f.Localizer.MustLocalize("root.cmd.example"),
PersistentPreRun: func(cmd *cobra.Command, args []string) {
f.Logger.SetDebug(debug.Enabled())
},
}

fs := cmd.PersistentFlags()
Expand Down

0 comments on commit 60732f1

Please sign in to comment.