containerd/log
Sebastiaan van Stijn 85a2c9a01b
log: swap logrus functions with their equivalent on default logger
[`logrus.SetLevel()`][1], [`logrus.GetLevel()`][2] and [`logrus.SetFormatter()`][3]
are all convenience functions to configure logrus' standardlogger, which is the
logger to which we hold a reference in the Entry configured on [`log.L`][4].

This patch:

- swaps calls to `logrus.SetLevel`, `logrus.GetLevel` and `logrus.SetFormatter`
  for their equivalents on `log.L`. This makes it clearer what `SetLevel` does,
  and makes sure that we set the log-level of the logger / entry we define in
  our package (even if that would be swapped with a different instance).
- removes the use of `logrus.NewEntry` with directly constructing a `Entry`,
  using the local `Entry` alias (anticipating we can swap that type in future).

[1]: dd1b4c2e81/exported.go (L34C1-L37)
[2]: dd1b4c2e81/exported.go (L39-L42)
[3]: dd1b4c2e81/exported.go (L23-L26)
[4]: dd1b4c2e81/exported.go (L9-L16)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-30 23:21:33 +02:00
..
logtest log/logtest: add testcase as debug field 2023-01-29 13:09:55 +08:00
context_test.go log: make Fields type a generic map[string]any 2023-07-30 22:55:37 +02:00
context.go log: swap logrus functions with their equivalent on default logger 2023-07-30 23:21:33 +02:00