Documentation ¶
Overview ¶
Package golog provides a rolling logger.
golog plays well with any logging package that can write to an io.Writer, including the standard library's log package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogWriter ¶
type LogWriter struct {
// contains filtered or unexported fields
}
LogWriter is an io.WriteCloser that writes logs to rotate files.
func New ¶
func New(logPath, logPrefix, logNameTimeFormat string, maxSize uint64, rotateInterval int) *LogWriter
New returns an initialized LogWriter.
func (*LogWriter) Write ¶
Write implements io.Writer. if the length of the writes is greater than maxSize, an error is returned if a write would cause the log file to be larger than maxSize, it will rotate to a new file if current time reaches rotate interval, it also will rotate to a new file if compress is set, old file will compress using gzip
Click to show internal directories.
Click to hide internal directories.