log

package
v0.0.0-...-0548c99 Latest Latest
Warning

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

Go to latest
Published: May 11, 2018 License: GPL-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StdoutHandler = NewSyncWriterHandler(os.Stdout)
	StderrHandler = NewSyncWriterHandler(os.Stderr)
)

Functions

This section is empty.

Types

type Level

type Level int
const (
	FATAL Level = iota
	ERROR
	WARNING
	INFO
	DEBUG
)

type Logger

type Logger interface {
	Fatal(format string, args ...interface{})
	Error(format string, args ...interface{})
	Warning(format string, args ...interface{})
	Info(format string, args ...interface{})
	Debug(format string, args ...interface{})

	IsError() bool
	IsWarning() bool
	IsInfo() bool
	IsDebug() bool

	SetLevel(level Level)
	SetHandler(logging.Handler)
}

func New

func New(name string) Logger

func NewWithSync

func NewWithSync(name string) Logger

type SyncWriterHandler

type SyncWriterHandler struct {
	*logging.BaseHandler

	Colorize bool
	sync.Mutex
	// contains filtered or unexported fields
}

func NewSyncWriterHandler

func NewSyncWriterHandler(w io.Writer) *SyncWriterHandler

func (*SyncWriterHandler) Close

func (b *SyncWriterHandler) Close()

func (*SyncWriterHandler) Handle

func (b *SyncWriterHandler) Handle(rec *logging.Record)

Jump to

Keyboard shortcuts

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