logger

package
v0.0.0-...-f67571d Latest Latest
Warning

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

Go to latest
Published: May 10, 2020 License: GPL-3.0 Imports: 1 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{})

Debugf debug format

func Errorf

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

Errorf error format

func Errorw

func Errorw(message string, args ...interface{})

Errorw error write

func Fatalw

func Fatalw(message string, args ...interface{})

Fatalw fatal write

func Infof

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

Infof info format

func Infow

func Infow(message string, args ...interface{})

Infow info write

func NewLogger

func NewLogger(l Logger)

NewLogger returns an instance of logger

func Warnf

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

Warnf warning format

func Warnw

func Warnw(message string, args ...interface{})

Warnw warning write

Types

type Fields

type Fields map[string]interface{}

Fields defines key value pair for structured logging when usig WithFields method.

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

	Infow(message string, args ...interface{})

	Warnw(message string, args ...interface{})

	Errorw(message string, args ...interface{})

	Fatalw(message string, args ...interface{})

	WithFields(keyValues Fields) Logger
}

Logger is our contract for the logger

func WithFields

func WithFields(keyValues Fields) Logger

WithFields add custom fields

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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