log

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

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

Debugf logs a debug 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 an informational message without context to stdout

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{})

Tracef logs a trace message without context to stdout

func Warnf

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

Warnf logs a warning message without context to stdout

Types

type Context added in v0.2.0

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

Context contains a structured context for logging

func NewContext

func NewContext() *Context

NewContext returns a Context with default settings

func WithContext

func WithContext() *Context

WithContext is an alias for NewContext

func (*Context) AddField added in v0.2.0

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

AddField adds a structured field to logctx

func (*Context) Debugf added in v0.2.0

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

Debugf logs a debug message for logctx to stdout

func (*Context) Errorf added in v0.2.0

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

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

func (*Context) Fatalf added in v0.2.0

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

Fatalf logs a fatal error message for logctx to stdout

func (*Context) Infof added in v0.2.0

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

Infof logs an informational message for logctx to stdout

func (*Context) Tracef added in v0.2.0

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

Tracef logs a debug message for logctx to stdout

func (*Context) Warnf added in v0.2.0

func (logctx *Context) 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