log

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

func Debugf(format string, args ...interface{})

Debugf logs a warning message without context to stdout

func Errorf

func Errorf(format string, args ...interface{})

Errorf logs an error message without context to stderr

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf logs a non-recoverable error message without context to stderr

func Infof

func Infof(format string, args ...interface{})

Infof logs a warning message without context to stdout

func Log

func Log() *logrus.Logger

Logger retrieves the native logger interface. Use with care.

func SetLogLevel

func SetLogLevel(logLevel string) error

SetLogLevel sets the log level to use for the logger

func Tracef

func Tracef(format string, args ...interface{})

Debugf logs a warning message without context to stdout

func Warnf

func Warnf(format string, args ...interface{})

Warnf logs a warning message without context to stdout

Types

type LogContext

type LogContext struct {
	// contains filtered or unexported fields
}

LogContext contains a structured context for logging

func NewContext

func NewContext() *LogContext

NewContext returns a LogContext with default settings

func WithContext

func WithContext() *LogContext

WithContext is an alias for NewContext

func (*LogContext) AddField

func (logctx *LogContext) AddField(key string, value interface{}) *LogContext

AddField adds a structured field to logctx

func (*LogContext) Debugf

func (logctx *LogContext) Debugf(format string, args ...interface{})

Debugf logs a debug message for logctx to stdout

func (*LogContext) Errorf

func (logctx *LogContext) Errorf(format string, args ...interface{})

Errorf logs a non-fatal error message for logctx to stdout

func (*LogContext) Fatalf

func (logctx *LogContext) Fatalf(format string, args ...interface{})

Fatalf logs a fatal error message for logctx to stdout

func (*LogContext) Infof

func (logctx *LogContext) Infof(format string, args ...interface{})

Infof logs an informational message for logctx to stdout

func (*LogContext) Tracef

func (logctx *LogContext) Tracef(format string, args ...interface{})

Tracef logs a debug message for logctx to stdout

func (*LogContext) Warnf

func (logctx *LogContext) Warnf(format string, args ...interface{})

Warnf logs a warning message for logctx to stdout

Jump to

Keyboard shortcuts

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