logging

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_SUBLOGGER_FORMAT = "{%s} %s"

Variables

This section is empty.

Functions

func Configure

func Configure(verbosity int, path *string)

func GetWriter added in v0.1.22

func GetWriter() io.Writer

func LogStack

func LogStack(log Logger, message string, skip int)

func SetBackend

func SetBackend(backend_ Backend)

func SetMaxLevel

func SetMaxLevel(name string, level Level)

Types

type Backend

type Backend interface {
	// If "path" is nil will log to stdout, colorized if possible
	// The default "verbosity" 0 will log criticals, errors, warnings, and notices.
	// "verbosity" 1 will add infos. "verbosity" 2 will add debugs.
	// Set "verbostiy" to -1 to disable the log.
	Configure(verbosity int, path *string)

	GetWriter() io.Writer
	SetMaxLevel(name string, level Level)
	GetLogger(name string) Logger
}

type FullLogger added in v0.1.21

type FullLogger struct {
	Logger PartialLogger
}

func (FullLogger) Critical added in v0.1.21

func (self FullLogger) Critical(message string)

func (FullLogger) Criticalf added in v0.1.21

func (self FullLogger) Criticalf(format string, values ...interface{})

func (FullLogger) Debug added in v0.1.21

func (self FullLogger) Debug(message string)

func (FullLogger) Debugf added in v0.1.21

func (self FullLogger) Debugf(format string, values ...interface{})

func (FullLogger) Error added in v0.1.21

func (self FullLogger) Error(message string)

func (FullLogger) Errorf added in v0.1.21

func (self FullLogger) Errorf(format string, values ...interface{})

func (FullLogger) Info added in v0.1.21

func (self FullLogger) Info(message string)

func (FullLogger) Infof added in v0.1.21

func (self FullLogger) Infof(format string, values ...interface{})

func (FullLogger) Notice added in v0.1.21

func (self FullLogger) Notice(message string)

func (FullLogger) Noticef added in v0.1.21

func (self FullLogger) Noticef(format string, values ...interface{})

func (FullLogger) Warning added in v0.1.21

func (self FullLogger) Warning(message string)

func (FullLogger) Warningf added in v0.1.21

func (self FullLogger) Warningf(format string, values ...interface{})

type LazyLogger added in v0.1.21

type LazyLogger struct {
	Name   string
	Logger Logger
	// contains filtered or unexported fields
}

func (*LazyLogger) Critical added in v0.1.21

func (self *LazyLogger) Critical(message string)

func (*LazyLogger) Criticalf added in v0.1.21

func (self *LazyLogger) Criticalf(format string, values ...interface{})

func (*LazyLogger) Debug added in v0.1.21

func (self *LazyLogger) Debug(message string)

func (*LazyLogger) Debugf added in v0.1.21

func (self *LazyLogger) Debugf(format string, values ...interface{})

func (*LazyLogger) Error added in v0.1.21

func (self *LazyLogger) Error(message string)

func (*LazyLogger) Errorf added in v0.1.21

func (self *LazyLogger) Errorf(format string, values ...interface{})

func (*LazyLogger) Info added in v0.1.21

func (self *LazyLogger) Info(message string)

func (*LazyLogger) Infof added in v0.1.21

func (self *LazyLogger) Infof(format string, values ...interface{})

func (*LazyLogger) Notice added in v0.1.21

func (self *LazyLogger) Notice(message string)

func (*LazyLogger) Noticef added in v0.1.21

func (self *LazyLogger) Noticef(format string, values ...interface{})

func (*LazyLogger) Warning added in v0.1.21

func (self *LazyLogger) Warning(message string)

func (*LazyLogger) Warningf added in v0.1.21

func (self *LazyLogger) Warningf(format string, values ...interface{})

type Level

type Level int
const (
	Critical Level = 1
	Error    Level = 2
	Warning  Level = 3
	Notice   Level = 4
	Info     Level = 5
	Debug    Level = 6
)

func (Level) String

func (self Level) String() string

fmt.Stringify interface

type Logger

type Logger interface {
	PartialLogger

	Criticalf(format string, values ...interface{})
	Errorf(format string, values ...interface{})
	Warningf(format string, values ...interface{})
	Noticef(format string, values ...interface{})
	Infof(format string, values ...interface{})
	Debugf(format string, values ...interface{})
}

func GetLogger

func GetLogger(name string) Logger

func GetLoggerf

func GetLoggerf(format string, arguments ...interface{}) Logger

type PartialLogger added in v0.1.21

type PartialLogger interface {
	Critical(message string)
	Error(message string)
	Warning(message string)
	Notice(message string)
	Info(message string)
	Debug(message string)
}

type SubLogger added in v0.1.21

type SubLogger struct {
	Logger Logger
	Name   string
	Format string
}

func NewSubLogger added in v0.1.21

func NewSubLogger(logger Logger, name string) SubLogger

func (SubLogger) Critical added in v0.1.21

func (self SubLogger) Critical(message string)

func (SubLogger) Criticalf added in v0.1.21

func (self SubLogger) Criticalf(format string, values ...interface{})

func (SubLogger) Debug added in v0.1.21

func (self SubLogger) Debug(message string)

func (SubLogger) Debugf added in v0.1.21

func (self SubLogger) Debugf(format string, values ...interface{})

func (SubLogger) Error added in v0.1.21

func (self SubLogger) Error(message string)

func (SubLogger) Errorf added in v0.1.21

func (self SubLogger) Errorf(format string, values ...interface{})

func (SubLogger) Info added in v0.1.21

func (self SubLogger) Info(message string)

func (SubLogger) Infof added in v0.1.21

func (self SubLogger) Infof(format string, values ...interface{})

func (SubLogger) Notice added in v0.1.21

func (self SubLogger) Notice(message string)

func (SubLogger) Noticef added in v0.1.21

func (self SubLogger) Noticef(format string, values ...interface{})

func (SubLogger) Warning added in v0.1.21

func (self SubLogger) Warning(message string)

func (SubLogger) Warningf added in v0.1.21

func (self SubLogger) Warningf(format string, values ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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