logging

package
v0.0.0-...-d57715f Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *zap.Logger

只能输出结构化日志,但是性能要高于 SugaredLogger

View Source
var SugarLogger *zap.SugaredLogger

可以输出 结构化日志、非结构化日志。性能差于 zap.Logger

Functions

func GetlogWriter

func GetlogWriter(logPath string, prefix, tag string) zapcore.WriteSyncer

func NewZapLogger

func NewZapLogger(logLevel, stdoutLevel zapcore.Level, prefix, logPath string) *zap.Logger

func Setup

func Setup(opt LoggerOpt)

Types

type LoggerOpt

type LoggerOpt struct {
	LogLevel    string
	StderrLevel string
	LogPath     string
}

Jump to

Keyboard shortcuts

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