Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 3ee3b37395
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (28 sloc) 0.556 kB
package steno
type TaggedLogger struct {
Logger
d map[string]interface{}
}
func NewTaggedLogger(l Logger, d map[string]interface{}) Logger {
tl := &TaggedLogger{
Logger: l,
d: d,
}
return Logger{tl}
}
func (l *TaggedLogger) Log(x LogLevel, m string, d map[string]interface{}) {
if d != nil {
e := make(map[string]interface{})
// Copy the logger's data
for k, v := range l.d {
e[k] = v
}
// Overwrite specified data
for k, v := range d {
e[k] = v
}
l.Logger.Log(x, m, e)
} else {
l.Logger.Log(x, m, l.d)
}
}
Jump to Line
Something went wrong with that request. Please try again.