std

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOnFatal = func(log.Event) {
	os.Exit(1)
}
View Source
var DefaultOnPanic = func(e log.Event) {
	if se, ok := e.(fmt.Stringer); ok {
		panic(se.String())
	} else {
		panic(fmt.Sprintf("%+v", e))
	}
}

Functions

func Configure

func Configure()

func ConfigureWith

func ConfigureWith(target log.CoreLogger, logAs log.Level)

func NewWrapper

func NewWrapper(target log.CoreLogger, logAs log.Level) *stdlog.Logger

Types

type Logger

type Logger interface {
	Print(...interface{})
	Printf(string, ...interface{})
	Println(...interface{})

	Fatal(...interface{})
	Fatalf(string, ...interface{})
	Fatalln(...interface{})

	Panic(...interface{})
	Panicf(string, ...interface{})
	Panicln(...interface{})
}

func NewLogger

func NewLogger(target log.CoreLogger) Logger

type LoggerImpl

type LoggerImpl struct {
	log.CoreLogger

	OnPanic func(log.Event)
	OnFatal func(log.Event)
}

func (*LoggerImpl) Fatal

func (instance *LoggerImpl) Fatal(args ...interface{})

func (*LoggerImpl) Fatalf

func (instance *LoggerImpl) Fatalf(s string, args ...interface{})

func (*LoggerImpl) Fatalln

func (instance *LoggerImpl) Fatalln(args ...interface{})

func (*LoggerImpl) Panic

func (instance *LoggerImpl) Panic(args ...interface{})

func (*LoggerImpl) Panicf

func (instance *LoggerImpl) Panicf(s string, args ...interface{})

func (*LoggerImpl) Panicln

func (instance *LoggerImpl) Panicln(args ...interface{})

func (*LoggerImpl) Print

func (instance *LoggerImpl) Print(args ...interface{})

func (*LoggerImpl) Printf

func (instance *LoggerImpl) Printf(s string, args ...interface{})

func (*LoggerImpl) Println

func (instance *LoggerImpl) Println(args ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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