log

package
v1.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLogLevel = WarnLevel

DefaultLogLevel for the global Skaffold logger

Variables

AllLevels exposes all logging levels

View Source
var ContextKey = contextKey{}

Functions

func AddHook added in v1.37.0

func AddHook(hook logrus.Hook)

AddHook adds a hook to the global Skaffold logger.

func Entry

func Entry(ctx context.Context) *logrus.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

func KanikoLogLevel() logrus.Level

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

func New() *logrus.Logger

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.

func SetLevel added in v1.37.0

func SetLevel(level Level)

SetLevel sets the global Skaffold logger level.

func SetupLogs added in v1.32.0

func SetupLogs(stdErr io.Writer, level string, timestamp bool, hook logrus.Hook) error

SetupLogs sets up logrus logger for skaffold command line

Types

type EventContext

type EventContext struct {
	Task    constants.Phase
	Subtask string
}

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.

func GetLevel added in v1.37.0

func GetLevel() Level

GetLevel returns the global Skaffold logger level.

func (Level) String added in v1.37.0

func (level Level) String() string

String converts the Level to a string. E.g. PanicLevel becomes "panic".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL