Documentation ¶
Overview ¶
Package provides a rotating file based on the file size.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SizedRotatingFile ¶
type SizedRotatingFile struct {
// contains filtered or unexported fields
}
SizedRotatingFile is a file rotating logging writer based on the size.
func NewSizedRotatingFile ¶
func NewSizedRotatingFile(filename string, filesize, filenum int, fileperm ...os.FileMode) *SizedRotatingFile
NewSizedRotatingFile returns a new SizedRotatingFile, which is not thread-safe.
Default:
fileperm: 0644 filesize: 100 * 1024 * 1024 filenum: 0
func (*SizedRotatingFile) Close ¶
func (f *SizedRotatingFile) Close() (err error)
Close implements io.Closer.
func (*SizedRotatingFile) Flush ¶
func (f *SizedRotatingFile) Flush() (err error)
Flush flushes the data to the underlying disk.
func (*SizedRotatingFile) Sync ¶
func (f *SizedRotatingFile) Sync() (err error)
Sync is equal to Flush to flush the data to the underlying disk.
Click to show internal directories.
Click to hide internal directories.