Documentation ¶
Index ¶
- Constants
- type Level
- type Option
- func WithFilename(logpath string) Option
- func WithIsStdOut(isstdout bool) Option
- func WithLogLevel(loglevel Level) Option
- func WithLogType(logtype string) Option
- func WithMaxAge(maxage int) Option
- func WithMaxSize(maxsize int) Option
- func WithProjectName(projectname string) Option
- func WithStacktrace(stacktrace Level) Option
- type Options
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 Option ¶
type Option func(*Options)
func WithFilename ¶
func WithIsStdOut ¶
func WithLogLevel ¶
func WithLogType ¶
func WithMaxAge ¶
func WithMaxSize ¶
func WithProjectName ¶
func WithStacktrace ¶
Click to show internal directories.
Click to hide internal directories.