moby--moby/daemon/logger
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
..
awslogs panic() instead of logrus.Fatal() in init funcs 2022-04-21 12:15:20 +02:00
etwlogs panic() instead of logrus.Fatal() in init funcs 2022-04-21 12:15:20 +02:00
fluentd panic() instead of logrus.Fatal() in init funcs 2022-04-21 12:15:20 +02:00
gcplogs panic() instead of logrus.Fatal() in init funcs 2022-04-21 12:15:20 +02:00
gelf panic() instead of logrus.Fatal() in init funcs 2022-04-21 12:15:20 +02:00
journald panic() instead of logrus.Fatal() in init funcs 2022-04-21 12:15:20 +02:00
jsonfilelog panic() instead of logrus.Fatal() in init funcs 2022-04-21 12:15:20 +02:00
local panic() instead of logrus.Fatal() in init funcs 2022-04-21 12:15:20 +02:00
logentries panic() instead of logrus.Fatal() in init funcs 2022-04-21 12:15:20 +02:00
loggerutils
splunk panic() instead of logrus.Fatal() in init funcs 2022-04-21 12:15:20 +02:00
syslog panic() instead of logrus.Fatal() in init funcs 2022-04-21 12:15:20 +02:00
templates
adapter.go
adapter_test.go
copier.go
copier_test.go
factory.go
log_cache_opts.go
logger.go
logger_error.go
logger_test.go
loginfo.go
metrics.go
plugin.go
plugin_unix.go
plugin_unsupported.go
proxy.go
ring.go
ring_test.go