logging

package
v4.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 9 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DEBUG    = &Level{scale: 7, display: "DEBUG"}
	INFO     = &Level{scale: 31, display: "INFO"}
	WARN     = &Level{scale: 63, display: "WARN"}
	ERROR    = &Level{scale: 127, display: "ERROR"}
	CRITICAL = &Level{scale: 255, display: "CRITICAL"}
	DEVEL    = &Level{scale: 0, display: "DEVEL"}
)
View Source
var Async = false

Functions

func AsWriter

func AsWriter(level *Level) io.Writer

This is simply a wrapper around the logger system so that interfaces which expect a Writer as a target will be able to use the logging structure we have located here.

func Close

func Close()

func Critical

func Critical(msg string, data ...interface{})

func Debug

func Debug(msg string, data ...interface{})

func Devel

func Devel(msg string, data ...interface{})

func Error

func Error(msg string, data ...interface{})

func Exception

func Exception(msg string, err error)

func Info

func Info(msg string, data ...interface{})

func Log

func Log(lvl *Level, msg string, data ...interface{})

func SetLevel

func SetLevel(writer io.Writer, lvl *Level)

func Warn

func Warn(msg string, data ...interface{})

func WithLogDirectory

func WithLogDirectory(directory string, lvl *Level, ignore *Level) (err error)

func WithWriter

func WithWriter(writer io.Writer, lvl *Level)

func WithWriterIgnore

func WithWriterIgnore(writer io.Writer, lvl *Level, ignored *Level)

Types

type Builder

type Builder interface {
	WithMessage(string) Builder
	WithError(error) Builder
	WithArgs(...interface{}) Builder
	Log()
}

func Build

func Build(lvl *Level) Builder

type Level

type Level struct {
	// contains filtered or unexported fields
}

func GetLevel

func GetLevel(name string) *Level

func (Level) GetName

func (l Level) GetName() string

func (Level) GetScale

func (l Level) GetScale() byte

Jump to

Keyboard shortcuts

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