@@ -18,20 +18,17 @@ package utils
1818
1919import (
2020 "crypto/ecdsa"
21+ "errors"
2122 "fmt"
2223 "io/ioutil"
23- "log"
2424 "math"
2525 "math/big"
26- "net/http"
2726 "os"
2827 "path/filepath"
2928 "runtime"
3029 "strconv"
3130 "strings"
3231
33- "errors"
34-
3532 "github.com/codegangsta/cli"
3633 "github.com/ethereum/ethash"
3734 "github.com/ethereum/go-ethereum/accounts"
@@ -223,35 +220,6 @@ var (
223220 }
224221
225222 // logging and debug settings
226- VerbosityFlag = cli.IntFlag {
227- Name : "verbosity" ,
228- Usage : "Logging verbosity: 0-6 (0=silent, 1=error, 2=warn, 3=info, 4=core, 5=debug, 6=debug detail)" ,
229- Value : int (logger .InfoLevel ),
230- }
231- LogFileFlag = cli.StringFlag {
232- Name : "logfile" ,
233- Usage : "Log output file within the data dir (default = no log file generated)" ,
234- Value : "" ,
235- }
236- LogVModuleFlag = cli.GenericFlag {
237- Name : "vmodule" ,
238- Usage : "Per-module verbosity: comma-separated list of <module>=<level>, where <module> is file literal or a glog pattern" ,
239- Value : glog .GetVModule (),
240- }
241- BacktraceAtFlag = cli.GenericFlag {
242- Name : "backtrace" ,
243- Usage : "Request a stack trace at a specific logging statement (e.g. \" block.go:271\" )" ,
244- Value : glog .GetTraceLocation (),
245- }
246- PProfEanbledFlag = cli.BoolFlag {
247- Name : "pprof" ,
248- Usage : "Enable the profiling server on localhost" ,
249- }
250- PProfPortFlag = cli.IntFlag {
251- Name : "pprofport" ,
252- Usage : "Profile server listening port" ,
253- Value : 6060 ,
254- }
255223 MetricsEnabledFlag = cli.BoolFlag {
256224 Name : metrics .MetricsEnabledFlag ,
257225 Usage : "Enable metrics collection and reporting" ,
@@ -297,7 +265,7 @@ var (
297265 Value : DirectoryString {common .DefaultIpcPath ()},
298266 }
299267 WSEnabledFlag = cli.BoolFlag {
300- Name : "ws" ,
268+ Name : "ws" ,
301269 Usage : "Enable the WS-RPC server" ,
302270 }
303271 WSListenAddrFlag = cli.StringFlag {
@@ -324,6 +292,7 @@ var (
324292 Name : "exec" ,
325293 Usage : "Execute JavaScript statement (only in combination with console/attach)" ,
326294 }
295+
327296 // Network Settings
328297 MaxPeersFlag = cli.IntFlag {
329298 Name : "maxpeers" ,
@@ -714,19 +683,6 @@ func MakeSystemNode(name, version string, extra []byte, ctx *cli.Context) *node.
714683 return stack
715684}
716685
717- // SetupLogger configures glog from the logging-related command line flags.
718- func SetupLogger (ctx * cli.Context ) {
719- glog .SetV (ctx .GlobalInt (VerbosityFlag .Name ))
720- glog .CopyStandardLogTo ("INFO" )
721- glog .SetToStderr (true )
722- if ctx .GlobalIsSet (LogFileFlag .Name ) {
723- logger .New ("" , ctx .GlobalString (LogFileFlag .Name ), ctx .GlobalInt (VerbosityFlag .Name ))
724- }
725- if ctx .GlobalIsSet (VMDebugFlag .Name ) {
726- vm .Debug = ctx .GlobalBool (VMDebugFlag .Name )
727- }
728- }
729-
730686// SetupNetwork configures the system for either the main net or some test network.
731687func SetupNetwork (ctx * cli.Context ) {
732688 switch {
@@ -746,6 +702,9 @@ func SetupVM(ctx *cli.Context) {
746702 vm .EnableJit = ctx .GlobalBool (VMEnableJitFlag .Name )
747703 vm .ForceJit = ctx .GlobalBool (VMForceJitFlag .Name )
748704 vm .SetJITCacheSize (ctx .GlobalInt (VMJitCacheFlag .Name ))
705+ if ctx .GlobalIsSet (VMDebugFlag .Name ) {
706+ vm .Debug = ctx .GlobalBool (VMDebugFlag .Name )
707+ }
749708}
750709
751710// MakeChain creates a chain manager from set command line flags.
@@ -873,10 +832,3 @@ func StartWS(stack *node.Node, ctx *cli.Context) error {
873832 glog .V (logger .Error ).Infof ("Unable to start RPC-WS interface, could not find admin API" )
874833 return errors .New ("Unable to start RPC-WS interface" )
875834}
876-
877- func StartPProf (ctx * cli.Context ) {
878- address := fmt .Sprintf ("localhost:%d" , ctx .GlobalInt (PProfPortFlag .Name ))
879- go func () {
880- log .Println (http .ListenAndServe (address , nil ))
881- }()
882- }
0 commit comments