Skip to content

Commit

Permalink
Fix logging stuff
Browse files Browse the repository at this point in the history
Fix #1, Fix #2, Fix #4, Fix #5
  • Loading branch information
Michael Demetriou committed Nov 15, 2019
1 parent 45d4cfb commit 8fab450
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ==========================")

Expand All @@ -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)
Expand Down

0 comments on commit 8fab450

Please sign in to comment.