Commit Graph

14 Commits

Author SHA1 Message Date
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
Daniel Nephin 4f0d95fa6e Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-05 16:51:57 -05:00
Derek McGowan 1009e6a40b
Update logrus to v1.0.1
Fixes case sensitivity issue

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-31 13:16:46 -07:00
Christopher Jones 069fdc8a08
[project] change syscall to /x/sys/unix|windows
Changes most references of syscall to golang.org/x/sys/
Ones aren't changes include, Errno, Signal and SysProcAttr
as they haven't been implemented in /x/sys/.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>

[s390x] switch utsname from unsigned to signed

per 33267e036f
char in s390x in the /x/sys/unix package is now signed, so
change the buildtags

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2017-07-11 08:00:32 -04:00
Alexander Morozov d38753303a Merge pull request #30136 from tg123/master
Windows: return err instead of panic when convert string to utf16
2017-02-06 14:00:00 -08:00
Brian Goff 3f4fccb65f Use sync.Pool for logger Messages
This reduces allocs and bytes used per log entry significantly as well
as some improvement to time per log operation.

Each log driver, however, must put messages back in the pool once they
are finished with the message.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-02-01 13:52:37 -05:00
Boshi Lian 1c770c6d8c return err instead of panic when convert string to utf16
Signed-off-by: Boshi Lian <farmer1992@gmail.com>
2017-01-14 02:21:22 +08:00
yupengzte 230b7c2e4c fix syscall.GUID composite literal uses unkeyed fields
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
2017-01-03 17:12:15 +08:00
Yanqiang Miao 17ec911da7 Rename 'context' to 'loginfo' in the logger module
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

gofmt

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

remove 'api/types/container/config.go' from this PR

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

change 'LogInfo' to 'Info'

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-12-29 19:13:44 +08:00
unclejack 3a42518042 daemon: return directly without ifs where possible
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2016-12-14 22:36:58 +02:00
Yanqiang Miao 52fd6e4664 Optimize the function 'Context.Name()' and replace 'Context.ContainerName' that need to remove slash with 'Context.Name()'.
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-11-24 09:24:29 +08:00
Darren Stahl 22c83c567f Swap usage of LazyDLL and LoadDLL to LazySystemDLL.
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-11-22 14:57:11 -08:00
allencloud c1be45fa38 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-06-02 17:17:22 +08:00
Cedric Davies 3fe60bbf95 Windows: Add ETW logging driver plug-in
Signed-off-by: Cedric Davies <cedricda@microsoft.com>
2016-02-16 13:24:49 -08:00