diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-13 22:06:32 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-13 22:06:32 +0800 |
commit | 75d164037fb9bbf75def7c5501727fd634ef124f (patch) | |
tree | e5be5bd595139ff7dfbe6261e1e659d8e7dd6f9c /eth/backend.go | |
parent | 38faf2c51a1e4a86cda5dfa1b4f7fdae4fd7f58d (diff) | |
parent | a5ea21cd85530eee6eb1bb83c37c20d009f11f74 (diff) | |
download | dexon-75d164037fb9bbf75def7c5501727fd634ef124f.tar.gz dexon-75d164037fb9bbf75def7c5501727fd634ef124f.tar.zst dexon-75d164037fb9bbf75def7c5501727fd634ef124f.zip |
Merge branch 'logjson' into develop
Diffstat (limited to 'eth/backend.go')
-rw-r--r-- | eth/backend.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/eth/backend.go b/eth/backend.go index 43e757435..ab348afe5 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -25,6 +25,7 @@ type Config struct { DataDir string LogFile string LogLevel int + LogFormat string KeyRing string MaxPeers int @@ -39,6 +40,7 @@ type Config struct { } var logger = ethlogger.NewLogger("SERV") +var jsonlogger = ethlogger.NewJsonLogger() type Ethereum struct { // Channel for shutting down the ethereum @@ -77,7 +79,7 @@ type Ethereum struct { func New(config *Config) (*Ethereum, error) { // Boostrap database - logger := ethlogger.New(config.DataDir, config.LogFile, config.LogLevel) + logger := ethlogger.New(config.DataDir, config.LogFile, config.LogLevel, config.LogFormat) db, err := ethdb.NewLDBDatabase("blockchain") if err != nil { return nil, err @@ -220,6 +222,13 @@ func (s *Ethereum) Coinbase() []byte { // Start the ethereum func (s *Ethereum) Start(seedNode string) error { + jsonlogger.LogJson(ðlogger.LogStarting{ + ClientString: s.ClientIdentity().String(), + Coinbase: ethutil.Bytes2Hex(s.KeyManager().Address()), + ProtocolVersion: ProtocolVersion, + LogEvent: ethlogger.LogEvent{Guid: ethutil.Bytes2Hex(s.ClientIdentity().Pubkey())}, + }) + err := s.net.Start() if err != nil { return err |