ulog

package module
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: MIT Imports: 4 Imported by: 2

README

ulog

日志工具

zerologlumberjack的简单封装.

使用见ulog_test.go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DebugLevel = zerolog.DebugLevel
	InfoLevel  = zerolog.InfoLevel
	WarnLevel  = zerolog.WarnLevel
	ErrorLevel = zerolog.ErrorLevel
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Filename   string            // 日志文件
	MaxSize    int               // megabytes
	MaxBackups int               // MaxBackups
	MaxAge     int               // days
	Fields     map[string]string // slog的初始化字段(session)
	IsJSON     bool              // 默认是非json格式
}

Config 可用在配置文件中

type Level added in v1.0.7

type Level = zerolog.Level

type Logger added in v1.0.3

type Logger = *zerolog.Logger

func New added in v1.0.4

func New(c Config) Logger

New 日常使用的log, 建议使用json效率更高

func NewConsole added in v1.0.4

func NewConsole() Logger

NewConsole 创建终端日志格式

Jump to

Keyboard shortcuts

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