diff --git a/mlog/llog.go b/mlog/mlog.go similarity index 96% rename from mlog/llog.go rename to mlog/mlog.go index 188f96c..6c498e8 100644 --- a/mlog/llog.go +++ b/mlog/mlog.go @@ -98,17 +98,18 @@ func LevelFromString(ls string) (Level, error) { // KVer is used to provide context to a log entry in the form of a dynamic set // of key/value pairs which can be different for every entry. // -// Each returned map should be modifiable. +// Each returned KV should be modifiable. type KVer interface { - KV() map[string]interface{} + KV() KV } -// KV is a simple and convenient implementation of KVer +// KV is a set of key/value pairs which provides context for a log entry by a +// KVer. KV is itself also a KVer. type KV map[string]interface{} -// KV implements the KVer method by returning a copy of the casted KV -func (kv KV) KV() map[string]interface{} { - nkv := make(map[string]interface{}, len(kv)) +// KV implements the KVer method by returning a copy of the KV +func (kv KV) KV() KV { + nkv := make(KV, len(kv)) for k, v := range kv { nkv[k] = v } diff --git a/mlog/llog_test.go b/mlog/mlog_test.go similarity index 100% rename from mlog/llog_test.go rename to mlog/mlog_test.go