diff --git a/.gitignore b/.gitignore index 2d0d7ba..c805fda 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ vendor .idea + +.DS_Store diff --git a/internal/test/testhub/cmd/receive.go b/internal/test/testhub/cmd/receive.go index 62289d4..8c13d94 100644 --- a/internal/test/testhub/cmd/receive.go +++ b/internal/test/testhub/cmd/receive.go @@ -33,6 +33,9 @@ var ( Use: "receive", Short: "Receive messages from an Event Hub", Args: func(cmd *cobra.Command, args []string) error { + if debug { + log.SetLevel(log.DebugLevel) + } return checkAuthFlags() }, Run: func(cmd *cobra.Command, args []string) { diff --git a/internal/test/testhub/cmd/root.go b/internal/test/testhub/cmd/root.go index 873b7c4..c11fdd9 100644 --- a/internal/test/testhub/cmd/root.go +++ b/internal/test/testhub/cmd/root.go @@ -13,10 +13,12 @@ func init() { rootCmd.PersistentFlags().StringVar(&hubName, "hub", "", "name of the Event Hub") rootCmd.PersistentFlags().StringVar(&sasKeyName, "key-name", "", "SAS key name for the Event Hub") rootCmd.PersistentFlags().StringVar(&sasKey, "key", "", "SAS key for the key-name") + rootCmd.PersistentFlags().BoolVar(&debug, "debug", false, "debug level logging") } var ( namespace, hubName, sasKeyName, sasKey string + debug bool rootCmd = &cobra.Command{ Use: "hubtest", diff --git a/internal/test/testhub/cmd/send.go b/internal/test/testhub/cmd/send.go index 5f17488..f20e715 100644 --- a/internal/test/testhub/cmd/send.go +++ b/internal/test/testhub/cmd/send.go @@ -24,6 +24,9 @@ var ( Use: "send", Short: "Send messages to an Event Hub", Args: func(cmd *cobra.Command, args []string) error { + if debug { + log.SetLevel(log.DebugLevel) + } return checkAuthFlags() }, Run: func(cmd *cobra.Command, args []string) {