conf

package
v0.0.0-...-e5af624 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 0 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Filename    string = "./log/default.log" //日志保存路径 //需要设置程序当前运行路径
	LogLevel    Level  = DebugLevel          //日志记录级别
	MaxSize     int    = 100                 //日志分割的尺寸 MB
	MaxAge      int    = 30                  //分割日志保存的时间 day
	Stacktrace  Level  = PanicLevel          //记录堆栈的级别
	IsStdOut    bool   = true                //是否标准输出console输出
	ProjectName string = "ZeLog"             //项目名称
	ProjectKey  string = "service"           //
	LogType            = LogNormalType
)

默认参数

View Source
const LogJsontype = "json"
View Source
const LogNormalType = "normal"

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int8

日志级别

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

func (Level) String

func (level Level) String() string

type Option

type Option func(*Options)

func WithFilename

func WithFilename(logpath string) Option

func WithIsStdOut

func WithIsStdOut(isstdout bool) Option

func WithLogLevel

func WithLogLevel(loglevel Level) Option

func WithLogType

func WithLogType(logtype 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 Level) Option

type Options

type Options struct {
	Filename    string //日志保存路径
	LogLevel    Level  //日志记录级别
	MaxSize     int    //日志分割的尺寸 MB
	MaxAge      int    //分割日志保存的时间 day
	Stacktrace  Level  //记录堆栈的级别
	IsStdOut    bool   //是否标准输出console输出
	ProjectName string //项目名称
	LogType     string //日志类型,普通 或 json
}

Jump to

Keyboard shortcuts

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