lager

package
v0.0.0-...-5dc8409 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package lager is the package for lager

Index

Constants

View Source
const (
	LogRotateDate  = 1
	LogRotateSize  = 10
	LogBackupCount = 7
)

constant values for logrotate parameters

Variables

View Source
var Logger lager.Logger

Logger is the global variable for the object of lager.Logger

Functions

func CopyFile

func CopyFile(srcFile, destFile string) error

CopyFile copy file

func EscapPath

func EscapPath(msg string) string

EscapPath escape path

func FilterFileList

func FilterFileList(path, pat string) ([]string, error)

FilterFileList function for filter file list path : where the file will be filtered pat : regexp pattern to filter the matched file

func Initialize

func Initialize(writers, loggerLevel, loggerFile, rollingPolicy string, logFormatText bool,
	LogRotateDate, LogRotateSize, LogBackupCount int)

Initialize Build constructs a *Lager.Logger with the configured parameters.

func LogRotate

func LogRotate(path string, MaxFileSize int, MaxBackupCount int)

LogRotate function for log rotate path: where log files need rollover MaxFileSize: MaxSize of a file before rotate. By M Bytes. MaxBackupCount: Max counts to keep of a log's backup files.

Types

type Lager

type Lager struct {
	Writers        string `yaml:"writers"`
	LoggerLevel    string `yaml:"logger_level"`
	LoggerFile     string `yaml:"logger_file"`
	LogFormatText  bool   `yaml:"log_format_text"`
	RollingPolicy  string `yaml:"rollingPolicy"`
	LogRotateDate  int    `yaml:"log_rotate_date"`
	LogRotateSize  int    `yaml:"log_rotate_size"`
	LogBackupCount int    `yaml:"log_backup_count"`
}

Lager struct for logger parameters

Jump to

Keyboard shortcuts

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