Documentation ¶
Overview ¶
Package rotate implements a Writer that will write to files in a directory and rotate them when they reach a specific size. It will also only keep a fixed number of files. It can be used anywhere an io.Writer is used, for example in log.SetOutput().
Index ¶
Constants ¶
This section is empty.
Variables ¶
var FilePerm = os.FileMode(0666)
FilePerm defines the permissions that Writer will use for all the files it creates.
var RootPerm = os.FileMode(0755)
RootPerm defines the permissions that Writer will use if it needs to create the root directory.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
Writer implements the io.Writer interface and writes to the "current" file in the root directory. When current's size exceeds max, it is renamed and a new file is created.
func New ¶
New creates a new Writer. The files will be created in the root directory. root will be created if necessary. The filenames will start with prefix.