Add logr implementation to README and json.RawMessage to Fields() (#337)
This commit is contained in:
parent
c1533bd5f8
commit
164ec91b0c
|
@ -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`
|
* [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`
|
* [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
|
## Benchmarks
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package zerolog
|
package zerolog
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"net"
|
"net"
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
@ -245,6 +246,8 @@ func appendFields(dst []byte, fields map[string]interface{}) []byte {
|
||||||
dst = enc.AppendIPPrefix(dst, val)
|
dst = enc.AppendIPPrefix(dst, val)
|
||||||
case net.HardwareAddr:
|
case net.HardwareAddr:
|
||||||
dst = enc.AppendMACAddr(dst, val)
|
dst = enc.AppendMACAddr(dst, val)
|
||||||
|
case json.RawMessage:
|
||||||
|
dst = appendJSON(dst, val)
|
||||||
default:
|
default:
|
||||||
dst = enc.AppendInterface(dst, val)
|
dst = enc.AppendInterface(dst, val)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue