File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import (
1919 "time"
2020)
2121
22+ var debug bool
2223var httpAddr string
2324var httpPath string
2425var eventTypes []string
@@ -57,6 +58,7 @@ func NewCommand() *cobra.Command {
5758 RunE : runDatadog ,
5859 }
5960
61+ cmd .PersistentFlags ().BoolVar (& debug , "debug" , false , "enable debug logging" )
6062 cmd .PersistentFlags ().StringVar (& httpAddr , "http-addr" , ":8080" ,
6163 "address on which the HTTP server will listen on" )
6264 cmd .PersistentFlags ().StringVar (& httpPath , "http-path" , "/" ,
@@ -79,7 +81,11 @@ func NewCommand() *cobra.Command {
7981
8082func runDatadog (cmd * cobra.Command , args []string ) error {
8183 // Initialize the logger
82- logger := zap .Must (zap .NewProduction ()).Sugar ()
84+ config := zap .NewProductionConfig ()
85+ if debug {
86+ config .Level = zap .NewAtomicLevelAt (zap .DebugLevel )
87+ }
88+ logger := zap .Must (config .Build ()).Sugar ()
8389
8490 // Initialize a Datadog sender
8591 var sender datadogsender.Sender
You can’t perform that action at this time.
0 commit comments