mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
![Sebastiaan van Stijn](/assets/img/avatar_default.png)
Full diff: https://github.com/sirupsen/logrus/compare/v1.3.0...v1.4.1 Fixes: - Remove dependency on golang.org/x/crypto - Fix wrong method calls Logger.Print and Logger.Warningln - Update Entry.Logf to not do string formatting unless the log level is enabled - Fix infinite recursion on unknown Level.String() - Fix race condition in getCaller - Fix Entry.WithContext method to return a copy of the initial entry New: - Add DeferExitHandler, similar to RegisterExitHandler but prepending the handler to the list of handlers (semantically like defer) - Add CallerPrettyfier to JSONFormatter and `TextFormatter` - Add Entry.WithContext() and Entry.Context, to set a context on entries to be used e.g. in hooks - Enhance TextFormatter to not print caller information when they are empty Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
17 lines
219 B
Go
17 lines
219 B
Go
// +build !appengine,!js,!windows
|
|
|
|
package logrus
|
|
|
|
import (
|
|
"io"
|
|
"os"
|
|
)
|
|
|
|
func checkIfTerminal(w io.Writer) bool {
|
|
switch v := w.(type) {
|
|
case *os.File:
|
|
return isTerminal(int(v.Fd()))
|
|
default:
|
|
return false
|
|
}
|
|
}
|