diff --git a/CHANGELOG.md b/CHANGELOG.md index 886231c8d..6a1609a21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,15 @@ # Changelog +## v1.7.1 (25 Sep 2017) + +Bugfixes: +* [#504][]: Store strings when using AddByteString with the map encoder. + ## v1.7.0 (21 Sep 2017) Enhancements: -* [#439][]: Add `NewStdLogAt`, which extends `NewStdLog` by allowing the user +* [#487][]: Add `NewStdLogAt`, which extends `NewStdLog` by allowing the user to specify the level of the logged messages. ## v1.6.0 (30 Aug 2017) @@ -258,6 +263,8 @@ upgrade to the upcoming stable release. [#465]: https://github.com/uber-go/zap/pull/465 [#460]: https://github.com/uber-go/zap/pull/460 [#470]: https://github.com/uber-go/zap/pull/470 +[#487]: https://github.com/uber-go/zap/pull/487 [#490]: https://github.com/uber-go/zap/pull/490 [#491]: https://github.com/uber-go/zap/pull/491 [#491]: https://github.com/uber-go/zap/pull/439 +[#504]: https://github.com/uber-go/zap/pull/504 diff --git a/zapcore/field_test.go b/zapcore/field_test.go index 2d8a45f9e..fb722b4b7 100644 --- a/zapcore/field_test.go +++ b/zapcore/field_test.go @@ -95,7 +95,7 @@ func TestFields(t *testing.T) { {t: ObjectMarshalerType, iface: users(2), want: map[string]interface{}{"users": 2}}, {t: BinaryType, iface: []byte("foo"), want: []byte("foo")}, {t: BoolType, i: 0, want: false}, - {t: ByteStringType, iface: []byte("foo"), want: []byte("foo")}, + {t: ByteStringType, iface: []byte("foo"), want: "foo"}, {t: Complex128Type, iface: 1 + 2i, want: 1 + 2i}, {t: Complex64Type, iface: complex64(1 + 2i), want: complex64(1 + 2i)}, {t: DurationType, i: 1000, want: time.Microsecond}, diff --git a/zapcore/memory_encoder.go b/zapcore/memory_encoder.go index 4805c8a94..5c46bc13d 100644 --- a/zapcore/memory_encoder.go +++ b/zapcore/memory_encoder.go @@ -60,7 +60,7 @@ func (m *MapObjectEncoder) AddObject(k string, v ObjectMarshaler) error { func (m *MapObjectEncoder) AddBinary(k string, v []byte) { m.cur[k] = v } // AddByteString implements ObjectEncoder. -func (m *MapObjectEncoder) AddByteString(k string, v []byte) { m.cur[k] = v } +func (m *MapObjectEncoder) AddByteString(k string, v []byte) { m.cur[k] = string(v) } // AddBool implements ObjectEncoder. func (m *MapObjectEncoder) AddBool(k string, v bool) { m.cur[k] = v }