From 8d1c2e770020949c89591b2e29ff16368ad32e2c Mon Sep 17 00:00:00 2001 From: Nacef LABIDI Date: Mon, 17 Dec 2018 03:53:29 +0100 Subject: [PATCH] Fix #7 Log formatting (#27) Thanks for this. --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index 2758f29..66124c7 100644 --- a/main.go +++ b/main.go @@ -68,6 +68,12 @@ func configureLog() { } log.SetLevel(ll) + + if *logFormat == "text" { + log.SetFormatter(&log.TextFormatter{}) + } else { + log.SetFormatter(&log.JSONFormatter{}) + } } func loadConfig() (*config.Config, error) {