logger

package module
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: MIT Imports: 5 Imported by: 0

README

go logger

简单封装了Zap Driver

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LevelMap = map[string]Level{"debug": DEBUG, "info": INFO, "warn": WARN, "error": ERROR, "fatal": FATAL}

Functions

func RegisterZapLogger

func RegisterZapLogger(level Level, hook *lumberjack.Logger, debug bool) *zapLogger

注册zap日志库

Types

type Extra

type Extra struct {
	Key   string
	Value interface{}
}

附加信息

type Level

type Level uint8
const (
	DEBUG Level = iota
	INFO
	WARN
	ERROR
	FATAL
)

type Logger

type Logger interface {
	SetLevel(level Level)
	Debugf(msg string, args []Extra)
	Infof(msg string, args []Extra)
	Warnf(msg string, args []Extra)
	Errorf(msg string, args []Extra)
	Fatalf(msg string, args []Extra)
}

func NewLogger

func NewLogger(filename string, maxSize, maxDay int, driver, level string, debug bool) Logger

Jump to

Keyboard shortcuts

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