Permalink
Browse files

commit

Signed-off-by: Peter Edge <peter.edge@gmail.com>
  • Loading branch information...
peter-edge committed Dec 5, 2016
1 parent 1cc3828 commit 2d5a99249f6aff9b59b5eb62be3dc6a5a14b827e
Showing with 6 additions and 1 deletion.
  1. +6 −1 logger.go
View
@@ -116,7 +116,12 @@ func (l *logger) WithField(key string, value interface{}) Logger {
func (l *logger) WithFields(fields map[string]interface{}) Logger {
contextFields := make(map[string]string, len(l.fields)+len(fields))
for key, value := range fields {
contextFields[key] = fmt.Sprintf("%v", value)
switch value.(type) {
case string:
contextFields[key] = value.(string)
default:
contextFields[key] = fmt.Sprintf("%v", value)
}
}
for key, value := range l.fields {
contextFields[key] = value

0 comments on commit 2d5a992

Please sign in to comment.