logger

package
v0.0.0-...-9fce2f1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

func Debugf(id, format string, v ...interface{})

func Errorf

func Errorf(id, format string, v ...interface{})

func Fatalf

func Fatalf(id, format string, v ...interface{})

func Infof

func Infof(id, format string, v ...interface{})

func Warnf

func Warnf(id, format string, v ...interface{})

Types

type Flag

type Flag int
const (
	Ftimestamp Flag = 1 << iota
	Fmicroseconds
	Futc
)

type Level

type Level int
const (
	Ldebug Level = iota
	Linfo
	Lwarn
	Lerror
	Lfatal
)

type Logger

type Logger interface {
	Output(Level, string, string, ...interface{}) (int, error)
}
var DefaultLogger Logger = New()

func New

func New(opts ...Option) Logger

type Option

type Option func(o *Options)

func Calldepth

func Calldepth(depth int) Option

func Writer

func Writer(w io.Writer) Option

type Options

type Options struct {
	Calldepth int
	Flags     Flag
	Writer    io.Writer
}

Jump to

Keyboard shortcuts

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