Documentation ¶
Index ¶
- Constants
- Variables
- func CleanHisLog(filePath string, keepCnt int)
- func Close() error
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func InitZlog(logFilePath string, logLevel LogLevel, modelLevel ModelLevel, ...)
- func Rename(filePath string) (err error)
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func WithContext(ctx context.Context) (spanId, traceId string)
- type DateFileManage
- type DateOption
- type FileManageOption
- type FileManageOptions
- type LogFileManage
- type LogFileManageOption
- type LogLevel
- type ModelLevel
- type Option
- type SetOutput
- type SizeFileManage
- type SizeOption
- type TimeFileManage
- type TimeOption
Constants ¶
View Source
const ( M10 = 1024 * 1024 * 10 M20 = 2 * M10 M50 = 5 * M10 M100 = 2 * M50 )
Variables ¶
Functions ¶
func CleanHisLog ¶
func InitZlog ¶
func InitZlog(logFilePath string, logLevel LogLevel, modelLevel ModelLevel, option ...LogFileManageOption)
func WithContext ¶ added in v0.1.4
Types ¶
type DateFileManage ¶
func NewDateCutMode ¶
func NewDateCutMode(filePath string, options ...FileManageOptions) *DateFileManage
NewDateCutMode 创建文件日期管理器, 默认1天1切
func (*DateFileManage) Close ¶
func (d *DateFileManage) Close() error
func (*DateFileManage) FilePath ¶
func (d *DateFileManage) FilePath() string
func (*DateFileManage) GetFile ¶
func (d *DateFileManage) GetFile() *os.File
func (*DateFileManage) IsCut ¶
func (d *DateFileManage) IsCut(f SetOutput) error
type DateOption ¶
type DateOption func(*DateFileManage)
type FileManageOption ¶
type FileManageOption struct {
// contains filtered or unexported fields
}
type FileManageOptions ¶
type FileManageOptions func(*FileManageOption)
func WithCutIntervalDay ¶
func WithCutIntervalDay(cutIntervalDay int) FileManageOptions
func WithCutIntervalTime ¶
func WithCutIntervalTime(cutInterval time.Duration) FileManageOptions
func WithCutSize ¶
func WithCutSize(cutSize int64) FileManageOptions
func WithKeepCnt ¶
func WithKeepCnt(keepCnt int) FileManageOptions
type LogFileManage ¶
type LogFileManageOption ¶
type LogFileManageOption func(*Option)
func WithLogFileManage ¶
func WithLogFileManage(logFileManage LogFileManage) LogFileManageOption
type SizeFileManage ¶
func NewSizeCutMode ¶
func NewSizeCutMode(filePath string, options ...FileManageOptions) *SizeFileManage
NewSizeCutMode 创建文件大小管理器, 默认20M切割
func (*SizeFileManage) Close ¶
func (s *SizeFileManage) Close() error
func (*SizeFileManage) FilePath ¶
func (s *SizeFileManage) FilePath() string
func (*SizeFileManage) GetFile ¶
func (s *SizeFileManage) GetFile() *os.File
func (*SizeFileManage) IsCut ¶
func (s *SizeFileManage) IsCut(f SetOutput) error
type SizeOption ¶
type SizeOption func(*SizeFileManage)
type TimeFileManage ¶
func NewTimeFileManage ¶
func NewTimeFileManage(filePath string, options ...FileManageOptions) *TimeFileManage
NewTimeFileManage 创建文件大小管理器, 默认20M切割
func (*TimeFileManage) Close ¶
func (t *TimeFileManage) Close() error
func (*TimeFileManage) FilePath ¶
func (t *TimeFileManage) FilePath() string
func (*TimeFileManage) GetFile ¶
func (t *TimeFileManage) GetFile() *os.File
func (*TimeFileManage) IsCut ¶
func (t *TimeFileManage) IsCut(f SetOutput) error
type TimeOption ¶
type TimeOption func(*TimeFileManage)
Click to show internal directories.
Click to hide internal directories.