lnlog

package
v0.0.0-...-ebe70a3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NopLogger *zap.Logger
)

Functions

func InitLogSystem

func InitLogSystem(cfg *Config) (logger *zap.Logger, level zap.AtomicLevel)

InitLogSystem with configuration

func NewLogger

func NewLogger(tag string) (logger *zap.Logger)

NewLogger returns sub logger with name

Types

type Config

type Config struct {
	// Filename is the file to write logs to
	Filename string
	// MaxSize is the maximum size in megabytes for a single log file
	MaxSize int
	// MaxAge is the maximum number of days to retain old log files
	MaxAge int
	// MaxBackups is the maximum number of log files to retain
	MaxBackups int
	// LocalTime determines if the time used for formatting timestamp of the backup files
	LocalTime bool
	// Compress determines if the rotated log files should be compress using gzip
	Compress bool
}

Config for log system

Jump to

Keyboard shortcuts

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