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:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user