forked from filecoin-project/venus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
50 lines (44 loc) · 1.35 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
44
45
46
47
48
49
50
package main
import (
"context"
_ "net/http/pprof"
"os"
logging "github.com/ipfs/go-log/v2"
"github.com/filecoin-project/venus/cmd"
)
func main() {
// set default log level if no flags given
lvl := os.Getenv("GO_FILECOIN_LOG_LEVEL")
if lvl == "" {
logging.SetAllLoggers(logging.LevelInfo)
_ = logging.SetLogLevel("statemanager", "info")
_ = logging.SetLogLevel("beacon", "error")
_ = logging.SetLogLevel("peer-tracker", "error")
_ = logging.SetLogLevel("dht", "error")
_ = logging.SetLogLevel("bitswap", "error")
_ = logging.SetLogLevel("graphsync", "info")
_ = logging.SetLogLevel("heartbeat", "error")
_ = logging.SetLogLevel("dagservice", "error")
_ = logging.SetLogLevel("peerqueue", "error")
_ = logging.SetLogLevel("swarm", "error")
_ = logging.SetLogLevel("swarm2", "error")
_ = logging.SetLogLevel("basichost", "error")
_ = logging.SetLogLevel("dht_net", "error")
_ = logging.SetLogLevel("pubsub", "error")
_ = logging.SetLogLevel("relay", "error")
_ = logging.SetLogLevel("dht/RtRefreshManager", "error")
} else {
level, err := logging.LevelFromString(lvl)
if err != nil {
level = logging.LevelInfo
}
logging.SetAllLoggers(level)
}
if len(os.Args) > 1 {
if os.Args[1] == "-v" {
os.Args[1] = "version"
}
}
code, _ := cmd.Run(context.Background(), os.Args, os.Stdin, os.Stdout, os.Stderr)
os.Exit(code)
}