logging

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// COMMAND is the user command used to initiate the logic.
	COMMAND = "command"
	// TARGET is the target being built.
	TARGET = "target"
)

Variables

This section is empty.

Functions

func With

func With(ctx context.Context, key string, value interface{}) context.Context

With adds logging metadata to the logger within the context.

func WithLogger

func WithLogger(ctx context.Context, l Logger) context.Context

WithLogger returns a new context with a logger added to it.

Types

type Logger

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

Logger represents a logger with some structured metadata associated.

func GetLogger

func GetLogger(ctx context.Context) Logger

GetLogger returns a logger associated with this context.

func (Logger) Debug

func (l Logger) Debug(msg string)

Debug logs debug message.

func (Logger) Error

func (l Logger) Error(err error)

Error logs error message.

func (Logger) Fatal

func (l Logger) Fatal(msg string)

Fatal logs fatal message and calls os.Exit(1).

func (Logger) Info

func (l Logger) Info(msg string)

Info logs info message.

func (Logger) Panic

func (l Logger) Panic(msg string)

Panic logs panic message and calls panic.

func (Logger) Warning

func (l Logger) Warning(msg string)

Warning logs warning message.

func (Logger) With

func (l Logger) With(key string, value interface{}) Logger

With adds metadata to the logger.

Jump to

Keyboard shortcuts

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