forked from filecoin-project/venus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
43 lines (36 loc) · 1.33 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"context"
"os"
logging "github.com/ipfs/go-log/v2"
"github.com/filecoin-project/go-filecoin/cmd/go-filecoin"
)
func main() {
// set default log level if no flags given
var level logging.LogLevel
var err error
lvl := os.Getenv("GO_FILECOIN_LOG_LEVEL")
if lvl == "" {
level = logging.LevelInfo
} else {
level, err = logging.LevelFromString(lvl)
if err != nil {
level = logging.LevelInfo
}
}
logging.SetAllLoggers(level)
logging.SetLogLevel("dht", "error") // nolint: errcheck
logging.SetLogLevel("bitswap", "error") // nolint: errcheck
logging.SetLogLevel("graphsync", "info") // nolint: errcheck
logging.SetLogLevel("heartbeat", "error") // nolint: errcheck
logging.SetLogLevel("blockservice", "error") // nolint: errcheck
logging.SetLogLevel("peerqueue", "error") // nolint: errcheck
logging.SetLogLevel("swarm", "error") // nolint: errcheck
logging.SetLogLevel("swarm2", "error") // nolint: errcheck
logging.SetLogLevel("basichost", "error") // nolint: errcheck
logging.SetLogLevel("dht_net", "error") // nolint: errcheck
logging.SetLogLevel("pubsub", "error") // nolint: errcheck
logging.SetLogLevel("relay", "error") // nolint: errcheck
code, _ := commands.Run(context.Background(), os.Args, os.Stdin, os.Stdout, os.Stderr)
os.Exit(code)
}