zdpgo_zap

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 1 Imported by: 3

README

zdpgo_zap

基于zap二次封装的日志库

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, kvs ...interface{})

Debug 记录debug类型的日志

func Error

func Error(msg string, kvs ...interface{})

Error 记录error类型的日志

func Fatal

func Fatal(msg string, kvs ...interface{})

Fatal 记录fatal类型的日志

func Info

func Info(msg string, kvs ...interface{})

Info 记录info类型的日志

func Panic

func Panic(msg string, kvs ...interface{})

Panic 记录panic类型的日志

func Warning

func Warning(msg string, kvs ...interface{})

Warning 记录warning类型的日志

Types

type Zap

type Zap struct {
	// contains filtered or unexported fields
}

Zap zap日志核心对象

func New

func New(config ZapConfig) *Zap

New 创建zap实例

func (*Zap) Debug

func (z *Zap) Debug(msg string, kvs ...interface{})

Debug 记录debug类型的日志

func (*Zap) Error

func (z *Zap) Error(msg string, kvs ...interface{})

Error 记录error类型的日志

func (*Zap) Fatal

func (z *Zap) Fatal(msg string, kvs ...interface{})

Fatal 记录fatal类型的日志

func (*Zap) Info

func (z *Zap) Info(msg string, kvs ...interface{})

Info 记录info类型的日志

func (*Zap) Panic

func (z *Zap) Panic(msg string, kvs ...interface{})

Panic 记录panic类型的日志

func (*Zap) Warning

func (z *Zap) Warning(msg string, kvs ...interface{})

Warning 记录warning类型的日志

type ZapConfig

type ZapConfig struct {
	Debug        bool   // 是否为debug模式
	OpenGlobal   bool   // 是否开启全局日志
	OpenFileName bool   // 是否输出文件名和行号
	LogFilePath  string // 日志路径
}

Directories

Path Synopsis
examples
z01_hello command

Jump to

Keyboard shortcuts

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