Skip to content

Commit 78fa461

Browse files
committed
discard badger output if verbose=false
1 parent aab5b17 commit 78fa461

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

init.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,20 @@ import (
1212

1313
"github.com/alash3al/color"
1414
pubsub "github.com/alash3al/go-pubsub"
15+
"github.com/dgraph-io/badger"
16+
"github.com/sirupsen/logrus"
1517
)
1618

1719
func init() {
1820
flag.Parse()
1921

2022
runtime.GOMAXPROCS(*flagWorkers)
2123

22-
// if !*flagVerbose {
23-
// logger := logrus.New()
24-
// logger.SetOutput(ioutil.Discard)
25-
// badger.SetLogger(logger)
26-
// }
24+
if !*flagVerbose {
25+
logger := logrus.New()
26+
logger.SetOutput(ioutil.Discard)
27+
badger.SetLogger(logger)
28+
}
2729

2830
if !supportedEngines[*flagEngine] {
2931
fmt.Println(color.RedString("Invalid strorage engine specified"))

0 commit comments

Comments
 (0)