mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
The "t" key overrides the log message time in JSON output. Co-authored-by: Roman Mazalov <83914728+gopherxyz@users.noreply.github.com> Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
parent
3a618f0fd2
commit
e7ca47c280
1 changed files with 3 additions and 3 deletions
|
|
@ -239,7 +239,7 @@ func (h *handler) handleImmediate(msg *jsonrpcMessage) bool {
|
||||||
return false
|
return false
|
||||||
case msg.isResponse():
|
case msg.isResponse():
|
||||||
h.handleResponse(msg)
|
h.handleResponse(msg)
|
||||||
h.log.Trace("Handled RPC response", "reqid", idForLog{msg.ID}, "t", time.Since(start))
|
h.log.Trace("Handled RPC response", "reqid", idForLog{msg.ID}, "duration", time.Since(start))
|
||||||
return true
|
return true
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
|
|
@ -291,12 +291,12 @@ func (h *handler) handleCallMsg(ctx *callProc, msg *jsonrpcMessage) *jsonrpcMess
|
||||||
switch {
|
switch {
|
||||||
case msg.isNotification():
|
case msg.isNotification():
|
||||||
h.handleCall(ctx, msg)
|
h.handleCall(ctx, msg)
|
||||||
h.log.Debug("Served "+msg.Method, "t", time.Since(start))
|
h.log.Debug("Served "+msg.Method, "duration", time.Since(start))
|
||||||
return nil
|
return nil
|
||||||
case msg.isCall():
|
case msg.isCall():
|
||||||
resp := h.handleCall(ctx, msg)
|
resp := h.handleCall(ctx, msg)
|
||||||
var ctx []interface{}
|
var ctx []interface{}
|
||||||
ctx = append(ctx, "reqid", idForLog{msg.ID}, "t", time.Since(start))
|
ctx = append(ctx, "reqid", idForLog{msg.ID}, "duration", time.Since(start))
|
||||||
if resp.Error != nil {
|
if resp.Error != nil {
|
||||||
ctx = append(ctx, "err", resp.Error.Message)
|
ctx = append(ctx, "err", resp.Error.Message)
|
||||||
if resp.Error.Data != nil {
|
if resp.Error.Data != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue