Updated README (#212)
Updated README to reflect changes in the code - included new field types available, corrected typos.
This commit is contained in:
parent
f7c93dce1c
commit
d9df1802de
12
README.md
12
README.md
|
@ -497,13 +497,17 @@ Some settings can be changed and will by applied to all loggers:
|
||||||
|
|
||||||
### Advanced Fields
|
### Advanced Fields
|
||||||
|
|
||||||
* `Err`: Takes an `error` and render it as a string using the `zerolog.ErrorFieldName` field name.
|
* `Err`: Takes an `error` and renders 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`.
|
* `Timestamp`: Inserts a timestamp field with `zerolog.TimestampFieldName` field name, formatted using `zerolog.TimeFieldFormat`.
|
||||||
* `Time`: Adds a field with the time formated with the `zerolog.TimeFieldFormat`.
|
* `Time`: Adds a field with time formatted with `zerolog.TimeFieldFormat`.
|
||||||
* `Dur`: Adds a field with a `time.Duration`.
|
* `Dur`: Adds a field with `time.Duration`.
|
||||||
* `Dict`: Adds a sub-key/value as a field of the event.
|
* `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.
|
* `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
|
## 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:
|
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:
|
||||||
|
|
Loading…
Reference in New Issue