moby/daemon/logger/local
Sebastiaan van Stijn df650a1aeb
panic() instead of logrus.Fatal() in init funcs
Some packages were using `logrus.Fatal()` in init functions (which logs the error,
and (by default) calls `os.Exit(1)` after logging).

Given that logrus formatting and outputs have not yet been configured during the
initialization stage, it does not provide much benefits over a plain `panic()`.

This patch replaces some instances of `logrus.Fatal()` with `panic()`, which has
the added benefits of not introducing logrus as a dependency in some of these
packages, and also produces a stacktrace, which could help locating the problem
in the unlikely event an `init()` fails.

Before this change, an error would look like:

    $ dockerd
    FATA[0000] something bad happened

After this change, the same error looks like:

    $ dockerd
    panic: something bad happened

    goroutine 1 [running]:
      github.com/docker/docker/daemon/logger/awslogs.init.0()
        /go/src/github.com/docker/docker/daemon/logger/awslogs/cloudwatchlogs.go:128 +0x89

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-21 12:15:20 +02:00
..
config.go Add new local log driver 2018-08-17 09:36:56 -07:00
doc.go Add new local log driver 2018-08-17 09:36:56 -07:00
local.go panic() instead of logrus.Fatal() in init funcs 2022-04-21 12:15:20 +02:00
local_test.go refactor: move from io/ioutil to io and os package 2021-08-27 14:56:57 +08:00
read.go daemon/logger: read the length header correctly 2021-12-15 15:13:02 -08:00
read_test.go test: use os.CreateTemp instead of ioutil.TempFile 2021-12-23 09:09:47 -08:00