log

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close stops global logger running queue.

func Debugf

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

Debugf uses fmt.Sprintf to log a `debug` templated message.

func Debugw

func Debugw(msg string, keysAndValues ...interface{})

Debugw writes a 'debug' message to configured logger with some additional context.

func Errorf

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

Errorf uses fmt.Sprintf to log an `error` templated message.

func Errorw

func Errorw(msg string, keysAndValues ...interface{})

Errorw writes an 'error' message to configured logger with some additional context.

func Fatalf

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

Fatalf uses fmt.Sprintf to log a `fatal` templated message.

func Fatalw

func Fatalw(msg string, keysAndValues ...interface{})

Fatalw writes a 'fatal' message to configured logger with some additional context.

func Infof

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

Infof uses fmt.Sprintf to log an `info` templated message.

func Infow

func Infow(msg string, keysAndValues ...interface{})

Infow writes a 'info' message to configured logger with some additional context.

func SetLogger

func SetLogger(lg Logger, lgLevel string)

SetLogger sets the global logger instance.

func Warnf

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

Warnf uses fmt.Sprintf to log a `warn` templated message.

func Warnw

func Warnw(msg string, keysAndValues ...interface{})

Warnw writes a 'warning' message to configured logger with some additional context.

Types

type Level

type Level int

Level represents log level type.

const (
	// DebugLevel represents DEBUG log level.
	DebugLevel Level = iota

	// InfoLevel represents INFO log level.
	InfoLevel

	// WarningLevel represents WARNING log level.
	WarningLevel

	// ErrorLevel represents ERROR log level.
	ErrorLevel

	// FatalLevel represents FATAL log level.
	FatalLevel

	// OffLevel represents a disabled logger log level.
	OffLevel
)

func (Level) String

func (l Level) String() string

String returns logger's level string representation.

type Logger

type Logger interface {
	// Debugf uses fmt.Sprintf to log a `debug` templated message.
	Debugf(msg string, args ...interface{})

	// Debugw writes a 'debug' message to configured logger with some additional context.
	Debugw(msg string, keysAndValues ...interface{})

	// Infof uses fmt.Sprintf to log an `info` templated message.
	Infof(msg string, args ...interface{})

	// Infow writes a 'info' message to configured logger with some additional context.
	Infow(msg string, keysAndValues ...interface{})

	// Warnf uses fmt.Sprintf to log a `warn` templated message.
	Warnf(msg string, args ...interface{})

	// Warnw writes a 'warning' message to configured logger with some additional context.
	Warnw(msg string, keysAndValues ...interface{})

	// Errorf uses fmt.Sprintf to log an `error` templated message.
	Errorf(msg string, args ...interface{})

	// Errorw writes an 'error' message to configured logger with some additional context.
	Errorw(msg string, keysAndValues ...interface{})

	// Fatalf uses fmt.Sprintf to log a `fatal` templated message.
	Fatalf(msg string, args ...interface{})

	// Fatalw writes a 'fatal' message to configured logger with some additional context.
	Fatalw(msg string, keysAndValues ...interface{})
}

Logger represents a common logger interface.

var Disabled Logger = &disabledLogger{}

Disabled stores a disabled logger instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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