logger

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: MIT Imports: 5 Imported by: 0

README

logger

zap日志封装

Documentation

Index

Constants

View Source
const (
	Console = "console"
	File    = "file"
)

Variables

View Source
var (
	Logger *zap.Logger
	Sugar  *zap.SugaredLogger
)

Functions

func DPanic

func DPanic(args ...interface{})

func DPanicf

func DPanicf(template string, args ...interface{})

func DPanicw

func DPanicw(msg string, keysAndValues ...interface{})

func Debug

func Debug(args ...interface{})

func Debugf

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

func Debugw

func Debugw(msg string, keysAndValues ...interface{})

func Error

func Error(args ...interface{})

func Errorf

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

func Errorw

func Errorw(msg string, keysAndValues ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

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

func Fatalw

func Fatalw(msg string, keysAndValues ...interface{})

func Info

func Info(args ...interface{})

func Infof

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

func Infow

func Infow(msg string, keysAndValues ...interface{})

func Init

func Init()

func InitLogger

func InitLogger(cfg *TLoggerConfig)

func NewEncoderConfig

func NewEncoderConfig() zapcore.EncoderConfig

func Panic

func Panic(args ...interface{})

func Panicf

func Panicf(templete string, args ...interface{})

func Panicw

func Panicw(msg string, keysAndValues ...interface{})

func SetLevel

func SetLevel(l zapcore.Level)

func SetTarget

func SetTarget(ta string)

func TimeEncoder

func TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)

func Warn

func Warn(args ...interface{})

func Warnf

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

func Warnw

func Warnw(msg string, keysAndValues ...interface{})

Types

type ILogger

type ILogger interface {
	Debug(args ...interface{})
	Debugf(template string, args ...interface{})
	Debugw(msg string, keysAndValues ...interface{})
	Info(args ...interface{})
	Infof(template string, args ...interface{})
	Infow(msg string, keysAndValues ...interface{})
	Warn(args ...interface{})
	Warnf(template string, args ...interface{})
	Warnw(msg string, keysAndValues ...interface{})
	Error(args ...interface{})
	Errorf(template string, args ...interface{})
	Errorw(msg string, keysAndValues ...interface{})
	DPanic(args ...interface{})
	DPanicf(template string, args ...interface{})
	DPanicw(msg string, keysAndValues ...interface{})
	Panic(args ...interface{})
	Panicf(msg string, args ...interface{})
	Panicw(msg string, keysAndValues ...interface{})
}

type TLoggerConfig

type TLoggerConfig struct {
	Filename   string `json:"filename"`
	MaxSize    int64  `json:"max_size"`
	MaxBackups int    `json:"max_backups"`
	MaxAge     int    `json:"max_age"`
}

Jump to

Keyboard shortcuts

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