From 59e5545f38e161332acd481f7f8084ff2c57b33e Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Mon, 13 Aug 2018 23:35:01 +1000 Subject: [PATCH] discard log output when not in debug mode --- pkg/app/app.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/app/app.go b/pkg/app/app.go index 011375737..d5a8f11c9 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -2,6 +2,7 @@ package app import ( "io" + "io/ioutil" "os" "github.com/Sirupsen/logrus" @@ -24,7 +25,7 @@ type App struct { func newLogger(config config.AppConfigurer) *logrus.Logger { log := logrus.New() if !config.GetDebug() { - log.Out = nil + log.Out = ioutil.Discard return log } file, err := os.OpenFile("development.log", os.O_CREATE|os.O_WRONLY, 0666)