logger

package
v0.0.0-...-3971eee Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Debug has verbose message
	Debug = "debug"
	//Info is default log level
	Info = "info"
	//Warn is for logging messages about possible issues
	Warn = "warn"
	//Error is for logging errors
	Error = "error"
	//Fatal is for logging fatal messages. The sytem shutsdown after logging the message.
	Fatal = "fatal"
)

Variables

This section is empty.

Functions

func Debugf

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

func Errorf

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

func Fatalf

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

func Infof

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

func Warnf

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

Types

type Configuration

type Configuration struct {
	EnableConsole     bool
	ConsoleJSONFormat bool
	ConsoleLevel      string
}

Configuration stores the config for the logger For some loggers there can only be one level across writers, for such the level of Console is picked by default

type Logger

type Logger interface {
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Fatalf(err error, format string, args ...interface{})
	WithFields(keyValues map[string]interface{}) Logger
}

func Context

func Context(ctx context.Context) Logger

func WithFields

func WithFields(keyValues map[string]interface{}) Logger

Jump to

Keyboard shortcuts

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