Commit db24fb79 authored by Taylor Gerring's avatar Taylor Gerring

Move standard fields to LogEvent

parent 3d6fd601
...@@ -224,9 +224,9 @@ func (s *Ethereum) MaxPeers() int { ...@@ -224,9 +224,9 @@ func (s *Ethereum) MaxPeers() int {
func (s *Ethereum) Start(seed bool) error { func (s *Ethereum) Start(seed bool) error {
jsonlogger.LogJson(&ethlogger.LogStarting{ jsonlogger.LogJson(&ethlogger.LogStarting{
ClientString: s.ClientIdentity().String(), ClientString: s.ClientIdentity().String(),
Guid: ethutil.Bytes2Hex(s.ClientIdentity().Pubkey()),
Coinbase: ethutil.Bytes2Hex(s.KeyManager().Address()), Coinbase: ethutil.Bytes2Hex(s.KeyManager().Address()),
ProtocolVersion: ProtocolVersion, ProtocolVersion: ProtocolVersion,
LogEvent: ethlogger.LogEvent{Guid: ethutil.Bytes2Hex(s.ClientIdentity().Pubkey())},
}) })
err := s.net.Start() err := s.net.Start()
......
...@@ -114,13 +114,15 @@ func (logger *Logger) Fatalf(format string, v ...interface{}) { ...@@ -114,13 +114,15 @@ func (logger *Logger) Fatalf(format string, v ...interface{}) {
os.Exit(0) os.Exit(0)
} }
type JsonLogger struct{} type JsonLogger struct {
Coinbase string
}
func NewJsonLogger() *JsonLogger { func NewJsonLogger() *JsonLogger {
return &JsonLogger{} return &JsonLogger{}
} }
func (logger *JsonLogger) LogJson(v LogEvent) { func (logger *JsonLogger) LogJson(v JsonLog) {
msgname := v.EventName() msgname := v.EventName()
obj := map[string]interface{}{ obj := map[string]interface{}{
msgname: v, msgname: v,
......
This diff is collapsed.
...@@ -20,8 +20,6 @@ const ( ...@@ -20,8 +20,6 @@ const (
var srvlog = logger.NewLogger("P2P Server") var srvlog = logger.NewLogger("P2P Server")
var jsonlogger = logger.NewJsonLogger()
// Server manages all peer connections. // Server manages all peer connections.
// //
// The fields of Server are used as configuration parameters. // The fields of Server are used as configuration parameters.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment