Skip to content

Commit

Permalink
Add logr implementation to README and json.RawMessage to Fields() (rs…
Browse files Browse the repository at this point in the history
  • Loading branch information
hn8 authored Aug 3, 2021
1 parent c1533bd commit 164ec91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ with zerolog library is [CSD](https://github.com/toravir/csd/).

* [grpc-zerolog](https://github.com/cheapRoc/grpc-zerolog): Implementation of `grpclog.LoggerV2` interface using `zerolog`
* [overlog](https://github.com/Trendyol/overlog): Implementation of `Mapped Diagnostic Context` interface using `zerolog`
* [zerologr](https://github.com/hn8/zerologr): Implementation of `logr.LogSink` interface using `zerolog`

## Benchmarks

Expand Down
3 changes: 3 additions & 0 deletions fields.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package zerolog

import (
"encoding/json"
"net"
"sort"
"time"
Expand Down Expand Up @@ -245,6 +246,8 @@ func appendFields(dst []byte, fields map[string]interface{}) []byte {
dst = enc.AppendIPPrefix(dst, val)
case net.HardwareAddr:
dst = enc.AppendMACAddr(dst, val)
case json.RawMessage:
dst = appendJSON(dst, val)
default:
dst = enc.AppendInterface(dst, val)
}
Expand Down

0 comments on commit 164ec91

Please sign in to comment.