aboutsummaryrefslogtreecommitdiffstats
path: root/log/logger.go
diff options
context:
space:
mode:
authorKurkó Mihály <kurkomisi@users.noreply.github.com>2018-07-11 15:59:04 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-07-11 15:59:04 +0800
commita9835c1816bc49ee54c82b4f2a5b05cbcd89881b (patch)
treee1badefd627aa3a7c4e1937eab22b8fe3eb204d1 /log/logger.go
parent2eedbe799f5eb8766e4808d8a1810cc1c90c4b93 (diff)
downloaddexon-a9835c1816bc49ee54c82b4f2a5b05cbcd89881b.tar
dexon-a9835c1816bc49ee54c82b4f2a5b05cbcd89881b.tar.gz
dexon-a9835c1816bc49ee54c82b4f2a5b05cbcd89881b.tar.bz2
dexon-a9835c1816bc49ee54c82b4f2a5b05cbcd89881b.tar.lz
dexon-a9835c1816bc49ee54c82b4f2a5b05cbcd89881b.tar.xz
dexon-a9835c1816bc49ee54c82b4f2a5b05cbcd89881b.tar.zst
dexon-a9835c1816bc49ee54c82b4f2a5b05cbcd89881b.zip
cmd, dashboard, log: log collection and exploration (#17097)
* cmd, dashboard, internal, log, node: logging feature * cmd, dashboard, internal, log: requested changes * dashboard, vendor: gofmt, govendor, use vendored file watcher * dashboard, log: gofmt -s -w, goimports * dashboard, log: gosimple
Diffstat (limited to 'log/logger.go')
-rw-r--r--log/logger.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/log/logger.go b/log/logger.go
index 438aa548f..ca3e0b059 100644
--- a/log/logger.go
+++ b/log/logger.go
@@ -11,6 +11,7 @@ import (
const timeKey = "t"
const lvlKey = "lvl"
const msgKey = "msg"
+const ctxKey = "ctx"
const errorKey = "LOG15_ERROR"
const skipLevel = 2
@@ -101,6 +102,7 @@ type RecordKeyNames struct {
Time string
Msg string
Lvl string
+ Ctx string
}
// A Logger writes key/value pairs to a Handler
@@ -139,6 +141,7 @@ func (l *logger) write(msg string, lvl Lvl, ctx []interface{}, skip int) {
Time: timeKey,
Msg: msgKey,
Lvl: lvlKey,
+ Ctx: ctxKey,
},
})
}