diff options
-rw-r--r-- | ethereal/config.go | 2 | ||||
-rw-r--r-- | ethereal/ethereum.go | 2 | ||||
-rw-r--r-- | ethereum/config.go | 2 | ||||
-rw-r--r-- | ethereum/ethereum.go | 7 |
4 files changed, 10 insertions, 3 deletions
diff --git a/ethereal/config.go b/ethereal/config.go index 817befc2c..3864126db 100644 --- a/ethereal/config.go +++ b/ethereal/config.go @@ -4,6 +4,7 @@ import ( "flag" ) +var Identifier string var StartConsole bool var StartMining bool var StartRpc bool @@ -21,6 +22,7 @@ var DataDir string var AssetPath string func Init() { + flag.StringVar(&Identifier, "i", "", "Custom client identifier") flag.BoolVar(&StartConsole, "c", false, "debug and testing console") flag.BoolVar(&StartMining, "m", false, "start dagger mining") flag.BoolVar(&StartRpc, "r", false, "start rpc server") diff --git a/ethereal/ethereum.go b/ethereal/ethereum.go index 206971b41..30187d956 100644 --- a/ethereal/ethereum.go +++ b/ethereal/ethereum.go @@ -39,7 +39,7 @@ func main() { runtime.GOMAXPROCS(runtime.NumCPU()) ethchain.InitFees() - ethutil.ReadConfig(DataDir, ethutil.LogFile|ethutil.LogStd) + ethutil.ReadConfig(DataDir, ethutil.LogFile|ethutil.LogStd, Identifier) // Instantiated a eth stack ethereum, err := eth.New(eth.CapDefault, UseUPnP) diff --git a/ethereum/config.go b/ethereum/config.go index f25f2fb66..f39f3b7da 100644 --- a/ethereum/config.go +++ b/ethereum/config.go @@ -6,6 +6,7 @@ import ( "os" ) +var Identifier string var StartMining bool var StartRpc bool var RpcPort int @@ -30,6 +31,7 @@ func Init() { flag.PrintDefaults() } + flag.StringVar(&Identifier, "i", "", "Custom client identifier") flag.BoolVar(&StartMining, "m", false, "start dagger mining") flag.BoolVar(&ShowGenesis, "g", false, "prints genesis header and exits") flag.BoolVar(&StartRpc, "r", false, "start rpc server") diff --git a/ethereum/ethereum.go b/ethereum/ethereum.go index 2fdfd5caf..34bacb7b9 100644 --- a/ethereum/ethereum.go +++ b/ethereum/ethereum.go @@ -52,12 +52,15 @@ func main() { var logSys *log.Logger flags := log.LstdFlags + var lt ethutil.LoggerType if StartJsConsole || len(InputFile) > 0 { - ethutil.ReadConfig(DataDir, ethutil.LogFile) + lt = ethutil.LogFile } else { - ethutil.ReadConfig(DataDir, ethutil.LogFile|ethutil.LogStd) + lt = ethutil.LogFile | ethutil.LogStd } + ethutil.ReadConfig(DataDir, lt, Identifier) + logger := ethutil.Config.Log if LogFile != "" { |