diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-09-21 13:15:10 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-09-21 14:27:36 +0300 |
commit | e52fdb6a6f09a1cfe7192272a7aabff0d7c84c4b (patch) | |
tree | 2e0598aacf334f3eb0afe3ce124590b715eb2766 /internal/command | |
parent | 2fd12987428f5f7b69d31253b86c1749e4a5935c (diff) |
log: Simplify Debug et al to accept single argument only
The functions `Debug()`, `Info()` and related accept multiple arguments.
The first hunch would be that the logger would format those arguments
via a call to `fmt.Sprintf()`, and that's seemingly also the assumption
that many of our callsites had. But in fact, the logrus logger will call
`fmt.Sprint()`, which joins the arguments by spaces when neither of the
arguments is a string.
While not being obvious, the current definition also conflicts with the
`slog` package. While the respective functions there also accept a
variable number of arguments, they will instead be interpreted as key
value pairs of structured data.
Let's simplify our calling conventions such that the functions only
accept a single message parameter and adjust callsites that misused
these functions accordingly. This fixes a source of misformatted log
messages and prepares us for the conversion to the `slog` package.
Diffstat (limited to 'internal/command')
0 files changed, 0 insertions, 0 deletions