logger

package
v0.0.0-...-d331868 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Level is the maximum level to output, logs with lower level are discarded.
	Level
	// Fields defines default fields to use with all messages.
	Fields
	// Output destination for levels: debug, info, warn
	Out io.Writer
	// Output destination for levels: error, fatal
	Err io.Writer
	// Do not log date and time if false
	Time bool
	// Use UTC time
	UTC bool
}

Config contains log level and default fields

type Fields

type Fields map[string]interface{}

Fields represents a set of log message fields

type Level

type Level int

Level defines log levels

const (
	LevelDebug Level = iota
	LevelInfo
	LevelWarn
	LevelError
	LevelFatal
)

Log levels

func (Level) String

func (l Level) String() string

type Logger

type Logger interface {
	// Debug logs a debug message
	Debug(v ...interface{})
	// Debug logs a debug message with format
	Debugf(format string, v ...interface{})
	// Info logs a info message
	Info(v ...interface{})
	// Info logs a info message with format
	Infof(format string, v ...interface{})
	// Warn logs a warning message.
	Warn(v ...interface{})
	// Warn logs a warning message with format.
	Warnf(format string, v ...interface{})
	// Error logs an error message
	Error(v ...interface{})
	// Error logs an error message with format
	Errorf(format string, v ...interface{})
	// Fatal logs an error message followed by a call to os.Exit(1)
	Fatal(v ...interface{})
	// Fatalf logs an error message with format followed by a call to ox.Exit(1)
	Fatalf(format string, v ...interface{})
}

Logger defines the interface for a compatible logger

Source Files

  • logger.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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