logger

package
v0.0.0-...-a5d5012 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DPanic

func DPanic(msg string, fields ...zap.Field)

func DPanicFormat

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

func Debug

func Debug(msg string, fields ...zap.Field)

func DebugFormat

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

func Error

func Error(msg string, fields ...zap.Field)

func ErrorFormat

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

func Fatal

func Fatal(msg string, fields ...zap.Field)

func FatalFormat

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

func Flush

func Flush()

func GetDate

func GetDate(fileName string) string

func Info

func Info(msg string, fields ...zap.Field)

func InfoFormat

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

func Panic

func Panic(msg string, fields ...zap.Field)

func PanicFormat

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

func SetDefaultLogger

func SetDefaultLogger(l *Logger)

func Warn

func Warn(msg string, fields ...zap.Field)

func WarnFormat

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

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func GetDefaultLogger

func GetDefaultLogger() *Logger

func InitDefaultLogger

func InitDefaultLogger(name, path string, lvl zapcore.Level, opts ...Option) (*Logger, error)

func NewLogger

func NewLogger(name, path string, lvl zapcore.Level, opts ...Option) (*Logger, error)

func (*Logger) DPanic

func (this_ *Logger) DPanic(msg string, fields ...zap.Field)

func (*Logger) DPanicFormat

func (this_ *Logger) DPanicFormat(format string, args ...interface{})

func (*Logger) Debug

func (this_ *Logger) Debug(msg string, fields ...zap.Field)

func (*Logger) DebugFormat

func (this_ *Logger) DebugFormat(format string, args ...interface{})

func (*Logger) Error

func (this_ *Logger) Error(msg string, fields ...zap.Field)

func (*Logger) ErrorFormat

func (this_ *Logger) ErrorFormat(format string, args ...interface{})

func (*Logger) Fatal

func (this_ *Logger) Fatal(msg string, fields ...zap.Field)

func (*Logger) FatalFormat

func (this_ *Logger) FatalFormat(format string, args ...interface{})

func (*Logger) Flush

func (this_ *Logger) Flush()

func (*Logger) Info

func (this_ *Logger) Info(msg string, fields ...zap.Field)

func (*Logger) InfoFormat

func (this_ *Logger) InfoFormat(format string, args ...interface{})

func (*Logger) Panic

func (this_ *Logger) Panic(msg string, fields ...zap.Field)

func (*Logger) PanicFormat

func (this_ *Logger) PanicFormat(format string, args ...interface{})

func (*Logger) Warn

func (this_ *Logger) Warn(msg string, fields ...zap.Field)

func (*Logger) WarnFormat

func (this_ *Logger) WarnFormat(format string, args ...interface{})

type Option

type Option func(o *Options)

func WithExpired

func WithExpired(day int64) Option

func WithFile

func WithFile() Option

func WithStderr

func WithStderr() Option

func WithStdout

func WithStdout() Option

type Options

type Options struct {
	IsStderr   bool
	IsStdout   bool
	IsFile     bool
	ExpiredDay int64
}

Jump to

Keyboard shortcuts

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