logger

package module
v0.0.0-...-b23a139 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2018 License: MIT Imports: 14 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

logger

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Destroy

func Destroy() error

Destroy 析构

func Reload

func Reload() error

Reload 重载日志

Types

type LogConf

type LogConf struct {
	EnableConsole   bool   `ini:"enable_console" comment:"启用控制台打印"`
	EnableTime      bool   `ini:"enable_time" comment:"启用时间戳"`
	EnablePos       bool   `ini:"enable_pos" comment:"增加日志位置"`
	EnableColor     bool   `ini:"enable_color" json:"enable_color" comment:"日志颜色"`
	TimestampFormat string `ini:"timestamp_format" json:"timestamp_format" comment:"时间格式"`
	LogFile         string `ini:"log_file" json:"log_file" comment:"日志文件名"`
	Level           string `ini:"level" json:"level" comment:"日志等级"`
	MaxSize         int    `ini:"max_size" json:"max_size" comment:"日志文件大小最大值, 单位(MB)"`
	MaxDays         int    `ini:"max_days" json:"max_days" comment:"日志最大保存时间, 单位(天)"`
	MaxBackups      int    `ini:"mac_backups" json:"mac_backups" comment:"日志备份最大数量"`
	Compress        bool   `ini:"compress" json:"compress"  comment:"是否压缩"`
}

LogConf 日志配置

type LogFormatter

type LogFormatter struct {
	EnableTime      bool
	EnablePos       bool
	EnableColor     bool
	TimestampFormat string
	CallerLevel     int
}

LogFormatter 日志格式化

func (*LogFormatter) Format

func (f *LogFormatter) Format(entry *log.Entry) ([]byte, error)

Format renders a single log entry

Jump to

Keyboard shortcuts

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