-
Notifications
You must be signed in to change notification settings - Fork 463
/
main.go
52 lines (46 loc) · 1.45 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
51
52
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")
_ = logging.SetLogLevel("pubsub-index-message", "error")
_ = logging.SetLogLevel("connmgr", "warn")
} 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)
}