conf

package
v2.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: GPL-3.0 Imports: 2 Imported by: 6

Documentation

Index

Constants

View Source
const (
	LogPath     string = "/var/log" //日志保存路径
	LogName     string = "output"   //日志保存的名称,不些随机生成
	LogLevel    string = "debug"    //日志记录级别
	MaxSize     int    = 100        //日志分割的尺寸 MB
	MaxAge      int    = 7          //分割日志保存的时间 day
	Stacktrace  string = "error"    //记录堆栈的级别
	IsStdOut    string = "yes"      //是否标准输出console输出
	ProjectName string = "test"     //项目名称

)

默认参数

Variables

Functions

This section is empty.

Types

type Level

type Level int8

日志级别

const (
	DebugLevel Level = iota
	InfoLevel
	WarnLevel
	ErrorLevel
	PanicLevel
	FatalLevel
)

func ParseLevel

func ParseLevel(lvl string) (Level, error)

func (Level) String

func (level Level) String() string

type Option

type Option func(*Options)

func WithIsStdOut

func WithIsStdOut(isstdout string) Option

func WithLogLevel

func WithLogLevel(loglevel string) Option

func WithLogName

func WithLogName(logname string) Option

func WithLogPath

func WithLogPath(logpath string) Option

func WithMaxAge

func WithMaxAge(maxage int) Option

func WithMaxSize

func WithMaxSize(maxsize int) Option

func WithProjectName

func WithProjectName(projectname string) Option

func WithStacktrace

func WithStacktrace(stacktrace string) Option

type Options

type Options struct {
	LogPath     string //日志保存路径
	LogName     string //日志保存的名称,不些随机生成
	LogLevel    string //日志记录级别
	MaxSize     int    //日志分割的尺寸 MB
	MaxAge      int    //分割日志保存的时间 day
	Stacktrace  string //记录堆栈的级别
	IsStdOut    string //是否标准输出console输出
	ProjectName string //项目名称
}

Jump to

Keyboard shortcuts

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