Thank you @mikerhodes.
> So "action: compaction_start" might be a useful one that these examples miss
> out.
We definitely missed `action` field. How would you add it to API? Are you
proposing to add into ExtraFields?
> Arguably you could have named bit in the string formatting that could read
> fields from ExtraFields to avoid having to have the FormatArgs argument. I
> don't know if Erlang's formatting supports it though.
Unfortunately Erlang `io_lib:format` doesn't support named arguments or
interpolation. However your comment lead me to one idea which I would like to
hear some feedback about from a wider audience. The idea is to use maps for
fields and pass list of fields to use in formatter in the order of appearance
in the format string.
```
couch_log:error("Compaction started for ~p", [shard], #{
user => "foo",
shard => "shards/..."
}).
```
[ Full content available at: https://github.com/apache/couchdb/issues/1373 ]
This message was relayed via gitbox.apache.org for [email protected]