-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make API for omitting keys more approachable. (#725)
* Explicitly document key omission in encoding Currently encoders will omit fields when encoding log entries if the key configured for that field is set to the empty string. However, this behavior isn't documented or specified explicitly as being part of the interface for encoding. This adds documentation to the `Encoder` interface that explicitly outlines the behavior that should be implemented when omitting fields. * Add key for omission to package API The empty string can be used to omit a key from a log line. However, there's no explicitly exposed API for using this behavior. This cleans up the API for users by allowing them to use a constant for omitting the key instead of throwing around `""` everywhere, or making their own constant and hoping that `""` will always omit the key.
- Loading branch information
Showing
3 changed files
with
13 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters