logs

package
v0.0.0-...-0cac27c Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Error = func(msg string, fields ...zap.Field) {
		log.Error(msg, fields...)
	}
	ErrorF = func(msg string, args ...interface{}) {
		slog.Errorf(msg, args...)
	}

	Warn = func(msg string, fields ...zap.Field) {
		log.Warn(msg, fields...)
	}
	WarnF = func(msg string, args ...interface{}) {
		slog.Warnf(msg, args...)
	}

	Info = func(msg string, fields ...zap.Field) {
		log.Info(msg, fields...)
	}
	InfoF = func(msg string, args ...interface{}) {
		slog.Infof(msg, args...)
	}

	Debug = func(msg string, fields ...zap.Field) {
		log.Debug(msg, fields...)
	}
	DebugF = func(msg string, args ...interface{}) {
		slog.Debugf(msg, args...)
	}
)

Functions

func GetFileLog

func GetFileLog() zapcore.WriteSyncer

func InitLogger

func InitLogger(logFile, level string, maxSize, maxAge int)

InitLogger 日志初始化, 参数: 日志文件名, 日志级别, 日志大小, 日志旧文件保留天数

Types

This section is empty.

Jump to

Keyboard shortcuts

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