Documentation ¶
Index ¶
- Constants
- Variables
- func AddHook(hook logrus.Hook)
- func Entry(ctx context.Context) *logrus.Entry
- func IsDebugLevelEnabled() bool
- func IsTraceLevelEnabled() bool
- func KanikoLogLevel() logrus.Level
- func New() *logrus.Logger
- func SetLevel(level Level)
- func SetupLogs(stdErr io.Writer, level string, timestamp bool, hook logrus.Hook) error
- type EventContext
- type Level
Constants ¶
const DefaultLogLevel = WarnLevel
DefaultLogLevel for the global Skaffold logger
Variables ¶
var AllLevels = []Level{ PanicLevel, FatalLevel, ErrorLevel, WarnLevel, InfoLevel, DebugLevel, TraceLevel, }
AllLevels exposes all logging levels
var ContextKey = contextKey{}
Functions ¶
func Entry ¶
Entry takes an context.Context and constructs a logrus.Entry from it, adding fields for task and subtask information
func IsDebugLevelEnabled ¶ added in v1.32.0
func IsDebugLevelEnabled() bool
IsDebugLevelEnabled returns true if debug level log is enabled.
func IsTraceLevelEnabled ¶ added in v1.32.0
func IsTraceLevelEnabled() bool
IsTraceLevelEnabled returns true if trace level log is enabled.
func KanikoLogLevel ¶ added in v1.32.0
KanikoLogLevel makes sure kaniko logs at least at Info level and at most Debug level (trace doesn't work with Kaniko)
func New ¶ added in v1.32.0
New returns a new logrus.Logger. We use a new instance instead of the default logrus singleton to avoid clashes with dependencies that also use logrus.
Types ¶
type EventContext ¶
type Level ¶ added in v1.37.0
type Level uint32
Level type for logging levels
const ( // PanicLevel level, highest level of severity. Logs and then calls panic with the // message passed to Debug, Info, ... PanicLevel Level = iota // FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the // logging level is set to Panic. FatalLevel // ErrorLevel level. Logs. Used for errors that should definitely be noted. // Commonly used for hooks to send errors to an error tracking service. ErrorLevel // WarnLevel level. Non-critical entries that deserve eyes. WarnLevel // InfoLevel level. General operational entries about what's going on inside the // application. InfoLevel // DebugLevel level. Usually only enabled when debugging. Very verbose logging. DebugLevel // TraceLevel level. Designates finer-grained informational events than the Debug. TraceLevel )
Logging levels. Defining our own so we can encapsulate the underlying logger implementation.