Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SizedLogWriter ¶
type SizedLogWriter struct { RotateSize int Path string FileMode os.FileMode // contains filtered or unexported fields }
Implements a line-by-line log file writer that appends to a file specified by Path until it reaches RotateSize bytes, at which point it will delete the file and start over with a fresh one.
Make sure to call Close() after this is no longer needed.
func (*SizedLogWriter) Close ¶
func (w *SizedLogWriter) Close() error
Close cleans up the associated resources
func (*SizedLogWriter) Mode ¶
func (w *SizedLogWriter) Mode() os.FileMode
func (*SizedLogWriter) Rotate ¶
func (w *SizedLogWriter) Rotate() error
func (*SizedLogWriter) WriteLine ¶
func (w *SizedLogWriter) WriteLine(line string) error
WriteLine appends a line to the end of the log file. If the log line would exceed the set RotateSize, then the log file will be rotated, and the line will be appended to the new log file.
Click to show internal directories.
Click to hide internal directories.