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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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