Skip to content

Commit

Permalink
add logger
Browse files Browse the repository at this point in the history
  • Loading branch information
iksaif committed Oct 13, 2023
1 parent d2b1de5 commit 46ca315
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions flooder/cmd/flood/flood.go
Expand Up @@ -39,4 +39,5 @@ func init() {
floodCmd.Flags().StringSliceP("tags", "", []string{}, "Set tags")
floodCmd.Flags().IntP("points-per-10seconds", "", 100000, "Set points per 10 seconds")
floodCmd.Flags().BoolP("send-at-start-of-bucket", "", false, "Send all the points at the start of the 10 sec time bucket.")
floodCmd.Flags().BoolP("verbose", "", false, "Enable verbose mode")
}
8 changes: 8 additions & 0 deletions flooder/pkg/flood/flood.go
Expand Up @@ -128,6 +128,14 @@ func initClient(command *cobra.Command) (*client, error) {

log.Printf("Tags: %v - Hash: %x", tags, h)

b, err = command.Flags().GetBool("verbose")
if err != nil {
return nil, err
}
if b {
options = append(options, statsd.WithErrorHandler(statsd.LoggingErrorHandler))
}

options = append(options, statsd.WithOriginDetection())

c, err := statsd.New(address, options...)
Expand Down

0 comments on commit 46ca315

Please sign in to comment.