From 8fab450afcf2fb238c8c722fe340d6e3d4ca4a6e Mon Sep 17 00:00:00 2001 From: Michael Demetriou Date: Fri, 15 Nov 2019 11:01:15 +0200 Subject: [PATCH] Fix logging stuff Fix #1, Fix #2, Fix #4, Fix #5 --- main.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index c28baa2..768aa46 100644 --- a/main.go +++ b/main.go @@ -17,8 +17,6 @@ var err error func main() { - // This is here for debugging purposes. I want to be able to easily spot in the terminal - // when a single execution starts fmt.Println() fmt.Println("======================= PHeRePHoNe ==========================") @@ -32,20 +30,22 @@ func main() { flag.Parse() if *debugFlag == true { - log.EnableLevel("info") - log.EnableLevel("error") + } // create a logger with levels but without prefixes for easier to read // debug output printer := log.New(os.Stdout, "", 0) printer.EnableLevel("error") + printer.EnableLevel("info") + log.EnableLevel("warn") if *debugFlag == true { - fmt.Println() - fmt.Println("debug mode on") + printer.Info() + printer.Info("debug mode on") + log.EnableLevel("info") + log.EnableLevel("error") log.EnableLevel("info") - printer.EnableLevel("info") } configurationFile := activityserve.Setup("config.ini", *debugFlag)