aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-03 23:09:01 +0800
committerobscuren <geffobscura@gmail.com>2015-04-03 23:09:11 +0800
commit36452afd4e31083d748155e5e5ddd682128aa9b0 (patch)
treefbd62ba8a03506b4fd570af8681cfe56d434b351 /cmd/utils/flags.go
parent4558e04c0d35d2d057a7182593e8baaa2d3adec0 (diff)
downloaddexon-36452afd4e31083d748155e5e5ddd682128aa9b0.tar
dexon-36452afd4e31083d748155e5e5ddd682128aa9b0.tar.gz
dexon-36452afd4e31083d748155e5e5ddd682128aa9b0.tar.bz2
dexon-36452afd4e31083d748155e5e5ddd682128aa9b0.tar.lz
dexon-36452afd4e31083d748155e5e5ddd682128aa9b0.tar.xz
dexon-36452afd4e31083d748155e5e5ddd682128aa9b0.tar.zst
dexon-36452afd4e31083d748155e5e5ddd682128aa9b0.zip
glog wip
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go19
1 files changed, 19 insertions, 0 deletions
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 &eth.Config{
Name: common.MakeName(clientID, version),
DataDir: ctx.GlobalString(DataDirFlag.Name),