From 9e16ac479ade0e14e5c3a915c59889daeae24e5c Mon Sep 17 00:00:00 2001 From: Denis Zheleztsov Date: Tue, 6 Nov 2018 14:19:40 +0300 Subject: [PATCH] Debug output --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 89997a7..f21ccce 100644 --- a/main.go +++ b/main.go @@ -15,6 +15,7 @@ var ( esMessagesType string add string email string + debug bool ) // init ... @@ -25,9 +26,12 @@ func init() { flag.StringVar(&esMessagesType, "estype", "post", "ES index type") flag.StringVar(&add, "add", "", "User to add") flag.StringVar(&email, "email", "", "User email address") + flag.BoolVar(&debug, "debug", false, "Debug output") flag.Parse() - log.SetLevel(log.DebugLevel) + if debug { + log.SetLevel(log.DebugLevel) + } } // main ...