Documentation ¶
Index ¶
Constants ¶
View Source
const ( FilePerm = os.FileMode(0644) DateFormat = "2006-01-02" )
FilePerm defines the permissions that Writer will use for all the files it creates.
Variables ¶
This section is empty.
Functions ¶
func NewFileWriter ¶
func NewFileWriter(filename string, interval time.Duration, maxSizeInBytes int64, maxArchives int) (io.WriteCloser, error)
NewFileWriter creates a new file writer.
Types ¶
type FileWriter ¶
FileWriter implements the io.Writer interface and writes to the filename specified. Will rotate at the specified interval and/or when the current file size exceeds maxSizeInBytes At rotation time, current file is renamed and a new file is created. If the number of archives exceeds maxArchives, older files are deleted.
func (*FileWriter) Close ¶
func (w *FileWriter) Close() (err error)
Close closes the current file. Writer is unusable after this is called.
Click to show internal directories.
Click to hide internal directories.