Documentation
¶
Index ¶
- Constants
- Variables
- func Shutdown()
- func Startup()
- type MsgOut
- type MsgPurge
- type MsgRotate
- type RotateHook
- type RotateOpt
- func BaseName(name string) RotateOpt
- func BasePath(path string) RotateOpt
- func ChunkSize(size int64) RotateOpt
- func Compress() RotateOpt
- func CompressEnabled(enabled bool) RotateOpt
- func HookBeforeDelete(hook RotateHook) RotateOpt
- func NumBackup(num int) RotateOpt
- func Quota(quota int64) RotateOpt
- func Uncompressed() RotateOpt
- type RotateOpts
- func (z RotateOpts) Apply(opts ...RotateOpt) RotateOpts
- func (z RotateOpts) BaseName() string
- func (z RotateOpts) BasePath() string
- func (z RotateOpts) ChunkSize() int64
- func (z RotateOpts) CurrentLogs() (entries []os.FileInfo, err error)
- func (z RotateOpts) CurrentName() string
- func (z RotateOpts) CurrentPath() string
- func (z RotateOpts) IsCompress() bool
- func (z RotateOpts) PurgeTargets() (purge []string, err error)
- type Writer
Constants ¶
View Source
const ( UnlimitedBackups = -1 UnlimitedQuota = -1 )
View Source
const (
RotateEnqueueTimeout = 10 * time.Second
)
Variables ¶
View Source
var (
ErrorLogFileNotAvailable = errors.New("log file is not available")
)
Functions ¶
Types ¶
type MsgOut ¶
type MsgOut struct { Path string Opts RotateOpts }
type MsgPurge ¶
type MsgPurge struct { Path string Opts RotateOpts }
type MsgRotate ¶
type MsgRotate struct {
Opts RotateOpts
}
type RotateHook ¶
type RotateHook func(path string)
Hook function that called when the log exceeds num backups. The file will be deleted after this function call.
type RotateOpt ¶
type RotateOpt func(o RotateOpts) RotateOpts
func ChunkSize ¶
Maximum size target for the single log file. Log file could exceed this size, but should not exceed too much.
func HookBeforeDelete ¶
func HookBeforeDelete(hook RotateHook) RotateOpt
Hook function that called when just before the file deleted.
type RotateOpts ¶
type RotateOpts struct {
// contains filtered or unexported fields
}
Rotate options
func NewRotateOpts ¶
func NewRotateOpts() RotateOpts
func (RotateOpts) BaseName ¶
func (z RotateOpts) BaseName() string
func (RotateOpts) BasePath ¶
func (z RotateOpts) BasePath() string
func (RotateOpts) ChunkSize ¶
func (z RotateOpts) ChunkSize() int64
func (RotateOpts) CurrentLogs ¶
func (z RotateOpts) CurrentLogs() (entries []os.FileInfo, err error)
func (RotateOpts) CurrentName ¶
func (z RotateOpts) CurrentName() string
Generate name of the current log file
func (RotateOpts) CurrentPath ¶
func (z RotateOpts) CurrentPath() string
Generate path to the current log file.
func (RotateOpts) IsCompress ¶
func (z RotateOpts) IsCompress() bool
func (RotateOpts) PurgeTargets ¶
func (z RotateOpts) PurgeTargets() (purge []string, err error)
Click to show internal directories.
Click to hide internal directories.