1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-27 22:38:09 +02:00

discard log output when not in debug mode

This commit is contained in:
Jesse Duffield
2018-08-13 23:35:01 +10:00
parent fb0004481b
commit 59e5545f38

View File

@@ -2,6 +2,7 @@ package app
import ( import (
"io" "io"
"io/ioutil"
"os" "os"
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
@@ -24,7 +25,7 @@ type App struct {
func newLogger(config config.AppConfigurer) *logrus.Logger { func newLogger(config config.AppConfigurer) *logrus.Logger {
log := logrus.New() log := logrus.New()
if !config.GetDebug() { if !config.GetDebug() {
log.Out = nil log.Out = ioutil.Discard
return log return log
} }
file, err := os.OpenFile("development.log", os.O_CREATE|os.O_WRONLY, 0666) file, err := os.OpenFile("development.log", os.O_CREATE|os.O_WRONLY, 0666)