Documentation ¶
Index ¶
Constants ¶
View Source
const ( LoglevelKey = "loglevel" LogdirKey = "logdir" LogrusKey = "logrus" LogTimeFormatKey = "logTimeFormat" LogMaxBackupsDaysKey = "logMaxBackupsDays" LogDebugKey = "logDebug" )
Variables ¶
View Source
var ( // UserHome is the directory of user home directory. UserHome string )
nolint gochecknoglobals
Functions ¶
func StartTicker ¶
Types ¶
type OptionFn ¶
type OptionFn func(*RotateFile)
OptionFn defines options func prototype to set options for RotateFile.
func MaxBackupsDays ¶
MaxBackupsDays defines the max backups for the log files.
func TimeFormat ¶
TimeFormat defines the backup file's postfix, like 20060102(yyyyMMdd) or 15:04:05 (HH:mm:ss)
type RotateFile ¶
type RotateFile struct { Filename string MaxBackupsDays int TimeFormat string Debug bool // contains filtered or unexported fields }
RotateFile is a daily rotate file
func NewRotateFile ¶
func NewRotateFile(filename string, optionFns ...OptionFn) (*RotateFile, error)
NewRotateFile create a daily rotation file
type TextFormatter ¶
type TextFormatter struct { }
TextFormatter extends the prefixed.TextFormatter with line joining.
Click to show internal directories.
Click to hide internal directories.