l

package
v1.2.20 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DebugLevel logs are typically voluminous, and are usually disabled in
	// production.
	DebugLevel = zapcore.DebugLevel
	// InfoLevel is the default logging priority.
	InfoLevel = zapcore.InfoLevel
	// WarnLevel logs are more important than Info, but don't need individual
	// human review.
	WarnLevel = zapcore.WarnLevel
	// ErrorLevel logs are high-priority. If an application is running smoothly,
	// it shouldn't generate any error-level logs.
	ErrorLevel = zapcore.ErrorLevel
)

Variables

This section is empty.

Functions

func Close

func Close()

Types

type Level

type Level = zapcore.Level

type Logger

type Logger struct {
	Option
	// contains filtered or unexported fields
}

func New

func New(opt Option) *Logger

func (*Logger) CleanColor

func (s *Logger) CleanColor() *Logger

func (*Logger) Close

func (s *Logger) Close()

func (*Logger) Color

func (s *Logger) Color(c TColor) *Logger

func (*Logger) Debugf

func (s *Logger) Debugf(msg string, args ...interface{})

func (*Logger) Debugw

func (s *Logger) Debugw(msg string, args ...interface{})

func (*Logger) DefaultMsg

func (s *Logger) DefaultMsg(msg string) *Logger

func (*Logger) Errorf

func (s *Logger) Errorf(msg string, args ...interface{})

func (*Logger) Errorw

func (s *Logger) Errorw(msg string, args ...interface{})

func (*Logger) Infof

func (s *Logger) Infof(msg string, args ...interface{})

func (*Logger) Infow

func (s *Logger) Infow(msg string, args ...interface{})

func (*Logger) Warnf

func (s *Logger) Warnf(msg string, args ...interface{})

func (*Logger) Warnw

func (s *Logger) Warnw(msg string, args ...interface{})

type Option

type Option struct {
	Level          Level  // 日志级别
	LogPath        string // 日志保存路径
	FileName       string // 日志文件名称
	FileMaxAge     int    // 文件保存时间(天)
	FileMaxSize    int    // 文件切割大小MB
	FileMaxBackups int    // 最大备份数量
	DisplayConsole bool   // 是否在控制台显示
	Skip           int    // 跳过的栈底
}

type TColor

type TColor = int
const (
	Blue TColor = iota + 1
	Yellow
	Green
	Magenta
	Cyan
	Gray
	White
	Red
)

Jump to

Keyboard shortcuts

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