add debug logging
This commit is contained in:
Родитель
26b7eaafc4
Коммит
ee34b430f9
|
@ -15,3 +15,5 @@
|
|||
|
||||
vendor
|
||||
.idea
|
||||
|
||||
.DS_Store
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче