log

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2019 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// Level of logging (panic, fatal, error, warn, info, default: debug)
	Level string
	// Output (default: os.Stdout)
	Output io.Writer
}

Configuration contains all configurations for logger

func (*Configuration) Validate

func (c *Configuration) Validate() error

Validate validates if the configuration is valid

type Fields

type Fields map[string]interface{}

Fields for structuring logging

type Logger

type Logger interface {
	Debug(args ...interface{})
	DebugWithFields(fields map[string]interface{}, args ...interface{})

	Info(args ...interface{})
	InfoWithFields(fields map[string]interface{}, args ...interface{})

	Warn(args ...interface{})
	WarnWithFields(fields map[string]interface{}, args ...interface{})

	Error(args ...interface{})
	ErrorWithFields(fields map[string]interface{}, args ...interface{})

	Fatal(args ...interface{})
	FatalWithFields(fields map[string]interface{}, args ...interface{})

	Panic(args ...interface{})
	PanicWithFields(fields map[string]interface{}, args ...interface{})
}

Logger interface for logging messages

func NewLogger

func NewLogger(config Configuration) (Logger, error)

NewLogger creates a new logger

Jump to

Keyboard shortcuts

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