Skip to content

log: Drop formatting functions from `Logger` interface

Patrick Steinhardt requested to merge pks-log-remove-formatting-functions into master

Next to Debug() and related functions our Logger interface also provides Debugf() and related functions that takes a formatting string as well as a set of arguments for it. There are multiple reasons though why we don't want to expose these functions:

- They do not exist in the `slog` package, which thus causes our own
  internal interface to diverge from our desired target solution.

- It is discouraged to put variable data into the message itself.
  Instead, callsites are encouraged to add any variable data as
  structured log data.

- It often gets abused in contexts where it's not required at all to
  call the formatting variant as all we pass in is a static string.

- We have a pending addition of logging functions that also take a
  context parameter as input. The formatting family would cause us
  to require four more functions that take such a context as input.

Let's remove the formatting functions in favor of the non-formatting ones. Most of the existing callsites are converted to instead use structured logging data.

Merge request reports