diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-03 23:09:01 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-03 23:09:11 +0800 |
commit | 36452afd4e31083d748155e5e5ddd682128aa9b0 (patch) | |
tree | fbd62ba8a03506b4fd570af8681cfe56d434b351 /cmd | |
parent | 4558e04c0d35d2d057a7182593e8baaa2d3adec0 (diff) | |
download | dexon-36452afd4e31083d748155e5e5ddd682128aa9b0.tar.gz dexon-36452afd4e31083d748155e5e5ddd682128aa9b0.tar.zst dexon-36452afd4e31083d748155e5e5ddd682128aa9b0.zip |
glog wip
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/geth/main.go | 2 | ||||
-rw-r--r-- | cmd/utils/flags.go | 19 |
2 files changed, 21 insertions, 0 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 62e30ac9a..a5c51d831 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -234,6 +234,8 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso utils.ProtocolVersionFlag, utils.NetworkIdFlag, utils.RPCCORSDomainFlag, + utils.BacktraceAtFlag, + utils.LogToStdErrFlag, } // missing: diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index e82fd9c28..e370cddec 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -15,6 +15,7 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/logger" + "github.com/ethereum/go-ethereum/logger/glog" "github.com/ethereum/go-ethereum/p2p/nat" "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/xeth" @@ -184,6 +185,15 @@ var ( Usage: "JS library path to be used with console and js subcommands", Value: ".", } + BacktraceAtFlag = cli.GenericFlag{ + Name: "backtrace_at", + Usage: "When set to a file and line number holding a logging statement a stack trace will be written to the Info log", + Value: glog.GetTraceLocation(), + } + LogToStdErrFlag = cli.BoolFlag{ + Name: "logtostderr", + Usage: "Logs are written to standard error instead of to files.", + } ) func GetNAT(ctx *cli.Context) nat.Interface { @@ -213,6 +223,15 @@ func GetNodeKey(ctx *cli.Context) (key *ecdsa.PrivateKey) { } func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config { + // Set verbosity on glog + glog.SetV(ctx.GlobalInt(LogLevelFlag.Name)) + // Set the log type + glog.SetToStderr(ctx.GlobalBool(LogToStdErrFlag.Name)) + + glog.V(2).Infoln("test it") + + glog.V(3).Infoln("other stuff") + return ð.Config{ Name: common.MakeName(clientID, version), DataDir: ctx.GlobalString(DataDirFlag.Name), |