zaplogger

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 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(debugLevel bool) (logger *zap.Logger)

NewLogger return a normal logger

func NewStdoutCore added in v0.2.2

func NewStdoutCore(level zapcore.Level) zapcore.Core

func NewZapCore added in v0.2.2

func NewZapCore(path, prefix string, level zapcore.Level) zapcore.Core

NewZapLog initial a zap logger

func NewZapLog

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

NewZapLog init a log

Types

type ZapLogger

type ZapLogger struct {
	Log *zap.Logger
}

ZapLogger is a logger which compatible to logrus/std zlog/prometheus. it implements Print() Println() Printf() Dbug() Debugln() Debugf() Info() Infoln() Infof() Warn() Warnln() Warnf() Error() Errorln() Errorf() Fatal() Fataln() Fatalf() Panic() Panicln() Panicf() With() WithField() WithFields()

func InitZapLogger

func InitZapLogger(log *zap.Logger) *ZapLogger

InitZaplogger

func NewZapLogger

func NewZapLogger(debugLevel bool) *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) Error

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

Error logs a message at level Error on the ZapLogger.

func (*ZapLogger) FastHttpZapLogHandler

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

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) Info

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

Info 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) 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) 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
Package diode provides a thread-safe, lock-free, non-blocking io.Writer wrapper.
Package diode provides a thread-safe, lock-free, non-blocking io.Writer wrapper.

Jump to

Keyboard shortcuts

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