zaplogger

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger() *zap.Logger

func NewZapLog

func NewZapLog(path, prefix string, stdoutFlag bool) *zap.Logger

NewZapLog init a log

func NewZlog added in v0.3.0

func NewZlog(debugLevel bool) (logger *zap.Logger)

NewLogger return a normal logger

Types

type ZapLogger

type ZapLogger struct {
	Log *zap.Logger
}

func InitZaoLogger added in v0.3.1

func InitZaoLogger(log *zap.Logger) *ZapLogger

InitZaoLogger initial

func NewDevelopment added in v0.3.1

func NewDevelopment() *ZapLogger

NewDevelopment new log for development

func NewProduction added in v0.3.1

func NewProduction() *ZapLogger

NewProduction new log for production

func NewZapLogger

func NewZapLogger() *ZapLogger

NewZapLogger return ZapLogger with caller field

func (*ZapLogger) Debug

func (l *ZapLogger) Debug(args ...interface{})

Debug logs a message at level Debug on the ZapLogger.

func (*ZapLogger) Debugf

func (l *ZapLogger) Debugf(template string, args ...interface{})

Debugf logs a message at level Debug on the ZapLogger.

func (*ZapLogger) Error

func (l *ZapLogger) Error(args ...interface{})

Error logs a message at level Error on the ZapLogger.

func (*ZapLogger) Errorf

func (l *ZapLogger) Errorf(template string, args ...interface{})

Errorf logs a message at level Warn on the ZapLogger.

func (*ZapLogger) FastHttpZapLogHandler

func (l *ZapLogger) FastHttpZapLogHandler(next phi.RequestHandlerFunc) phi.RequestHandlerFunc

FastHttpZapLogHandler middle-ware for fasthttp

func (*ZapLogger) Fatal

func (l *ZapLogger) Fatal(args ...interface{})

Fatal logs a message at level Fatal on the ZapLogger.

func (*ZapLogger) Fatalf

func (l *ZapLogger) Fatalf(template string, args ...interface{})

Fatalf logs a message at level Warn on the ZapLogger.

func (*ZapLogger) Info

func (l *ZapLogger) Info(args ...interface{})

Info logs a message at level Info on the ZapLogger.

func (*ZapLogger) Infof

func (l *ZapLogger) Infof(template string, args ...interface{})

Infof logs a message at level Info on the ZapLogger.

func (*ZapLogger) Panic

func (l *ZapLogger) Panic(args ...interface{})

Panic logs a message at level Painc on the ZapLogger.

func (*ZapLogger) Panicf

func (l *ZapLogger) Panicf(template string, args ...interface{})

Panicf logs a message at level Warn on the ZapLogger.

func (*ZapLogger) Print

func (l *ZapLogger) Print(args ...interface{})

Print logs a message at level Info on the ZapLogger.

func (*ZapLogger) Printf

func (l *ZapLogger) Printf(format string, args ...interface{})

Printf logs a message at level Info on the ZapLogger.

func (*ZapLogger) Warn

func (l *ZapLogger) Warn(args ...interface{})

Warn logs a message at level Warn on the ZapLogger.

func (*ZapLogger) Warnf

func (l *ZapLogger) Warnf(template string, args ...interface{})

Warnf logs a message at level Warn on the ZapLogger.

func (*ZapLogger) With

func (l *ZapLogger) With(key string, value interface{}) *ZapLogger

With return a logger with an extra field.

func (*ZapLogger) WithField

func (l *ZapLogger) WithField(key string, value interface{}) *ZapLogger

WithField return a logger with an extra field.

func (*ZapLogger) WithFields

func (l *ZapLogger) WithFields(fields map[string]interface{}) *ZapLogger

WithFields return a logger with extra fields.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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