Add Geth Logging (#5474)

* add new logging
* Update beacon-chain/main.go
* Merge refs/heads/master into gethLogging
* Merge refs/heads/master into gethLogging
* Merge refs/heads/master into gethLogging
* Merge refs/heads/master into gethLogging
* fix image
* Merge refs/heads/master into gethLogging
This commit is contained in:
Nishant Das 2020-04-18 14:23:45 +08:00 committed by GitHub
parent c0ca567175
commit b0af12d5dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,7 @@ go_library(
"//shared/featureconfig:go_default_library",
"//shared/logutil:go_default_library",
"//shared/version:go_default_library",
"@com_github_ethereum_go_ethereum//log:go_default_library",
"@com_github_ipfs_go_log//:go_default_library",
"@com_github_joonix_log//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
@ -57,6 +58,7 @@ go_image(
"//shared/featureconfig:go_default_library",
"//shared/logutil:go_default_library",
"//shared/version:go_default_library",
"@com_github_ethereum_go_ethereum//log:go_default_library",
"@com_github_ipfs_go_log//:go_default_library",
"@com_github_joonix_log//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",

View File

@ -7,6 +7,7 @@ import (
"runtime"
runtimeDebug "runtime/debug"
gethlog "github.com/ethereum/go-ethereum/log"
golog "github.com/ipfs/go-log"
joonix "github.com/joonix/log"
"github.com/prysmaticlabs/prysm/beacon-chain/flags"
@ -167,7 +168,12 @@ func startNode(ctx *cli.Context) error {
}
logrus.SetLevel(level)
if level == logrus.TraceLevel {
// libp2p specific logging.
golog.SetAllLoggers(gologging.DEBUG)
// Geth specific logging.
glogger := gethlog.NewGlogHandler(gethlog.StreamHandler(os.Stderr, gethlog.TerminalFormat(true)))
glogger.Verbosity(gethlog.LvlTrace)
gethlog.Root().SetHandler(glogger)
}
beacon, err := node.NewBeaconNode(ctx)