logger

package
v0.0.0-...-730ab85 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func DebugF

func DebugF(format string, args ...interface{})

func Error

func Error(args ...interface{})

func ErrorF

func ErrorF(format string, args ...interface{})

func Fatal

func Fatal(args ...interface{})

func FatalF

func FatalF(format string, args ...interface{})

func Info

func Info(args ...interface{})

func InfoF

func InfoF(format string, args ...interface{})

func SetLog

func SetLog(logger Logger)

func Warn

func Warn(args ...interface{})

func WarnF

func WarnF(format string, args ...interface{})

Types

type Level

type Level int8
const (
	TraceLevel Level = iota - 2
	DebugLevel
	InfoLevel
	WarnLevel
	ErrorLevel
	FatalLevel
)

func (Level) String

func (l Level) String() string

type Logger

type Logger interface {
	Log(level Level, args ...interface{})
	Logf(level Level, format string, args ...interface{})
	Info(args ...interface{})
	InfoF(format string, args ...interface{})
	Debug(args ...interface{})
	DebugF(format string, args ...interface{})
	Warn(args ...interface{})
	WarnF(format string, args ...interface{})
	Error(args ...interface{})
	ErrorF(format string, args ...interface{})
	Fatal(args ...interface{})
	FatalF(format string, args ...interface{})
	Type() string
}

func NewZap

func NewZap(opts *Options) (Logger, error)

type Option

type Option func(*Options)

func Fields

func Fields(fields map[string]interface{}) Option

func Merge

func Merge(opts *Options) Option

type Options

type Options struct {
	Level       Level
	Development bool

	LogFileDir    string
	AppName       string
	ErrorFileName string
	WarnFileName  string
	InfoFileName  string
	DebugFileName string
	MaxSize       int
	MaxBackups    int
	MaxAge        int
	// contains filtered or unexported fields
}

func NewOptions

func NewOptions(opts ...Option) *Options

type Transformer

type Transformer struct {
}

func (Transformer) Transformer

func (t Transformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error

Jump to

Keyboard shortcuts

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