Documentation ¶
Overview ¶
Package log is used to collect information of running application and then transport them to destination.
Package log plan to provide a log collect component that can output application log to console and file meanwhile. In addition, log that is exported to file can be rotated automatically by Mode and file size.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustNewLogger ¶
MustNewLogger just call NewLogger, but if there are errors, process will
Types ¶
type AutoRotateWriter ¶
type AutoRotateWriter struct {
// contains filtered or unexported fields
}
AutoRotateWriter implement io.Writer interface, this writer will write content to different file by configuration.
func NewAutoRotateWriter ¶
func NewAutoRotateWriter(file string, maxBytes uint64) (*AutoRotateWriter, error)
NewAutoRotateWriter is used return a writer, that will change to another writer when the size of current file will be up to maxBytes.
func (*AutoRotateWriter) Close ¶
func (a *AutoRotateWriter) Close() error
Close is used to implement io.Close