From d9df1802de8b99f4e97aa88056ea5d2cea663bb4 Mon Sep 17 00:00:00 2001 From: Milo Date: Sat, 15 Feb 2020 17:27:26 +0000 Subject: [PATCH] Updated README (#212) Updated README to reflect changes in the code - included new field types available, corrected typos. --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bd28c29..c690ed9 100644 --- a/README.md +++ b/README.md @@ -497,13 +497,17 @@ Some settings can be changed and will by applied to all loggers: ### Advanced Fields -* `Err`: Takes an `error` and render it as a string using the `zerolog.ErrorFieldName` field name. -* `Timestamp`: Insert a timestamp field with `zerolog.TimestampFieldName` field name and formatted using `zerolog.TimeFieldFormat`. -* `Time`: Adds a field with the time formated with the `zerolog.TimeFieldFormat`. -* `Dur`: Adds a field with a `time.Duration`. +* `Err`: Takes an `error` and renders it as a string using the `zerolog.ErrorFieldName` field name. +* `Timestamp`: Inserts a timestamp field with `zerolog.TimestampFieldName` field name, formatted using `zerolog.TimeFieldFormat`. +* `Time`: Adds a field with time formatted with `zerolog.TimeFieldFormat`. +* `Dur`: Adds a field with `time.Duration`. * `Dict`: Adds a sub-key/value as a field of the event. +* `RawJSON`: Adds a field with an already encoded JSON (`[]byte`) +* `Hex`: Adds a field with value formatted as a hexadecimal string (`[]byte`) * `Interface`: Uses reflection to marshal the type. +Most fields are also available in the slice format (`Strs` for `[]string`, `Errs` for `[]error` etc.) + ## Binary Encoding In addition to the default JSON encoding, `zerolog` can produce binary logs using [CBOR](http://cbor.io) encoding. The choice of encoding can be decided at compile time using the build tag `binary_log` as follows: