diff --git a/cli/setup.go b/cli/setup.go index 8993a14e..10dd4714 100644 --- a/cli/setup.go +++ b/cli/setup.go @@ -258,6 +258,7 @@ func setup() { if opts.Logging.Output != "" { chk := map[string]bool{ + "none": true, "stdout": true, "stderr": true, } diff --git a/cli/start.go b/cli/start.go index 513f55b3..f877546a 100644 --- a/cli/start.go +++ b/cli/start.go @@ -31,7 +31,9 @@ var startCmd = &cobra.Command{ Short: "Start the database and http server", PreRun: func(cmd *cobra.Command, args []string) { - fmt.Print(logo) + if opts.Logging.Output != "none" { + fmt.Print(logo) + } }, RunE: func(cmd *cobra.Command, args []string) (err error) { diff --git a/log/log.go b/log/log.go index d94f489d..63242a33 100644 --- a/log/log.go +++ b/log/log.go @@ -18,6 +18,8 @@ import ( "os" "time" + "io/ioutil" + "github.com/sirupsen/logrus" ) @@ -230,6 +232,8 @@ func (l *Logger) SetFormat(v string) { // SetOutput sets the logging output of the logger instance. func (l *Logger) SetOutput(v string) { switch v { + case "none": + l.Out = ioutil.Discard case "stdout": l.Out = os.Stdout case "stderr":