diff options
author | zelig <viktor.tron@gmail.com> | 2015-03-21 17:20:47 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-03-22 10:16:54 +0800 |
commit | 78cff9e3a4c71d003c5ab3f5747ccae1dbc959fe (patch) | |
tree | 0bdc1bb55b9bd73730f9de658e1d87273482761a /cmd | |
parent | 7f85608f30a2e34005c8d15566849229c758c2f1 (diff) | |
download | dexon-78cff9e3a4c71d003c5ab3f5747ccae1dbc959fe.tar.gz dexon-78cff9e3a4c71d003c5ab3f5747ccae1dbc959fe.tar.zst dexon-78cff9e3a4c71d003c5ab3f5747ccae1dbc959fe.zip |
independent flag for json structured logging
- logjson flag remove logformat flag
- passed to eth Config
- logsystem not a field of Ethereum
- LogSystem does not need to expose GetLogLevel/SetLogLevel
- message struct just implements more generic LogMsg interface
- LogMsg is a fmt.Stringer with Level()
- jsonMsg ([]byte) implements LogMsg
- remove "raw" systems
- move level logic inside StdLogSystem
- logsystems only print their kind of msg: jsonLogSystem prints jsonMsg, StdLogSystem prints stdMsg
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/ethereum/main.go | 2 | ||||
-rw-r--r-- | cmd/utils/flags.go | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 7d5854230..17dcbb59e 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -135,7 +135,7 @@ The Ethereum JavaScript VM exposes a node admin interface as well as the DAPP Ja utils.JSpathFlag, utils.ListenPortFlag, utils.LogFileFlag, - utils.LogFormatFlag, + utils.LogJSONFlag, utils.LogLevelFlag, utils.MaxPeersFlag, utils.MinerThreadsFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 1d8f6382b..f87d25ce9 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -117,10 +117,10 @@ var ( Usage: "0-5 (silent, error, warn, info, debug, debug detail)", Value: int(logger.InfoLevel), } - LogFormatFlag = cli.StringFlag{ - Name: "logformat", - Usage: `"std" or "raw"`, - Value: "std", + LogJSONFlag = cli.StringFlag{ + Name: "logjson", + Usage: "Send json structured log output to a file or '-' for standard output (default: no json output)", + Value: "", } VMDebugFlag = cli.BoolFlag{ Name: "vmdebug", @@ -213,7 +213,7 @@ func MakeEthConfig(clientID, version string, ctx *cli.Context) *eth.Config { NetworkId: ctx.GlobalInt(NetworkIdFlag.Name), LogFile: ctx.GlobalString(LogFileFlag.Name), LogLevel: ctx.GlobalInt(LogLevelFlag.Name), - LogFormat: ctx.GlobalString(LogFormatFlag.Name), + LogJSON: ctx.GlobalString(LogJSONFlag.Name), MinerThreads: ctx.GlobalInt(MinerThreadsFlag.Name), AccountManager: GetAccountManager(ctx), VmDebug: ctx.GlobalBool(VMDebugFlag.Name), |