Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @rodaine ,
today I stumbled across this library and would like to propose another
protoslog.Option
.I have the need to generate the key for a field based on its type. Please give me some feedback whether you would accept this addition to your library.
Lets assume there are the following proto messages.
Logging an incoming event using your library will produces the following log entries. For simplicity log attributes like time and level are removed.
These logs are collected and pushed into a logstorage. When it parses the log entries, having two equal keys (
event.id
from both payloads) with different types will result in an error. Using the added option, I can provide a function that will extend the key with a suffix based on the actual payloads type. Afterwards the log entries would look like this:If you consider to accept this PR, I will add some tests using the above mentioned example.