lager

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

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

constant values for log rotate parameters

View Source
const (
	LevelDebug = "DEBUG"
	LevelInfo  = "INFO"
)

log level

View Source
const (
	Stdout = "stdout"
	File   = "file"
)

output type

Variables

This section is empty.

Functions

func Init

func Init(option *Options)

Init Build constructs a *Lager.logger with the configured parameters.

func NewLog

func NewLog(option *Options) (lager.Logger, error)

NewLog returns a logger

Types

type Options

type Options struct {
	Writers       string `yaml:"logWriters"`
	LoggerLevel   string `yaml:"logLevel"`
	LoggerFile    string `yaml:"logFile"`
	LogFormatText bool   `yaml:"logFormatText"`
	LogColorMode  string `yaml:"logColorMode"`

	LogRotateDisable  bool `yaml:"logRotateDisable"`
	LogRotateCompress bool `yaml:"logRotateCompress"`
	LogRotateAge      int  `yaml:"logRotateAge"`
	LogRotateSize     int  `yaml:"logRotateSize"`
	LogBackupCount    int  `yaml:"logBackupCount"`

	AccessLogFile string `yaml:"accessLogFile"`
}

Options is the struct for lager information(lager.yaml)

Jump to

Keyboard shortcuts

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