You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many/Most LogSink impls (especially strict JSON and similar) inject "special" keys into the log output ("err" in case of Error(), "msg", "caller", etc). It's possible for these to collide with user-provided keys. Mostly we say "well, it was documented" (and hopefully it was), but this sort of requires callers to know which LogSink is in use, which is unfortunate.
How could we solve this?
We could choose to "group" keys (we didn't in the past, but there's always v2 :). We'd still have to pick a name for the group in the root keyspace, e.g.
#196 (comment)
Many/Most LogSink impls (especially strict JSON and similar) inject "special" keys into the log output ("err" in case of Error(), "msg", "caller", etc). It's possible for these to collide with user-provided keys. Mostly we say "well, it was documented" (and hopefully it was), but this sort of requires callers to know which LogSink is in use, which is unfortunate.
How could we solve this?
We could choose to "group" keys (we didn't in the past, but there's always v2 :). We'd still have to pick a name for the group in the root keyspace, e.g.
We could name-prefix keys (e.g. "logr/name") but it seems unfortunate to embed "logr" into the keyspace. E.g.:
We could puntuation-prefix keys (e.g. keys which start with "_" are reserved), then we can argue about "_foo" vs "@foo" vs "%foo".
We could make the prefix or key user-defined, and pass it around through
Logger
instances, and exceptLogSink
s to respect it.We could group or prefix all the user-provided keys (again, maybe configurable?). E.g.
The text was updated successfully, but these errors were encountered: