Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultTimeRollingPerDayFormat = "2006-01-02" DefaultTimeRollingPerHourFormat = "2006-01-02-15" DefaultTimeRollingPerMinuteFormat = "2006-01-02-15_04" DefaultTimeRollingPerSecondFormat = "2006-01-02-15_04_05" )
View Source
const (
DefaultTimeFormat = `2006-01-02T15-04-05.000`
)
Variables ¶
View Source
var DefaultTimeRollingNamer = TimeRollingNamerFunc(func(filename string, timeformat string, now time.Time) string { return fmt.Sprintf("%s.%s", filename, now.Format(timeformat)) })
Functions ¶
This section is empty.
Types ¶
type FakeClocker ¶
func (*FakeClocker) Now ¶
func (f *FakeClocker) Now() time.Time
func (*FakeClocker) SetNow ¶
func (f *FakeClocker) SetNow(n time.Time)
type FileRotateWriter ¶
type FileRotateWriter struct {
// contains filtered or unexported fields
}
func NewFileRotateWriter ¶
func NewFileRotateWriter(filename string) (*FileRotateWriter, error)
func (*FileRotateWriter) Close ¶
func (w *FileRotateWriter) Close() error
func (*FileRotateWriter) Rotate ¶
func (w *FileRotateWriter) Rotate(filename, rotatename string) error
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
func (*Option) EnableCompress ¶
func (*Option) EnableLocalTime ¶
func (*Option) SetMaxBackups ¶
func (*Option) SetMaxSize ¶
type RollingWriter ¶
type RollingWriter struct {
// contains filtered or unexported fields
}
func New ¶
func New(filename string, option *Option) *RollingWriter
func (*RollingWriter) Close ¶
func (rw *RollingWriter) Close() error
type RotateWriter ¶
type RotateWriter interface { io.WriteCloser Rotate(name, rotatename string) error }
type TimeRollingNamer ¶
type TimeRollingNamerFunc ¶
type TimeRollingWriter ¶
func NewTimeRollingWriter ¶
func NewTimeRollingWriter(filename string, option *TimeRollingWriterOption) (*TimeRollingWriter, error)
func (*TimeRollingWriter) Close ¶
func (trw *TimeRollingWriter) Close() error
type TimeRollingWriterOption ¶
type TimeRollingWriterOption struct { TimeFormat string Clocker Clocker AppendTimeHeader bool RotateWriter RotateWriter TimeRollingNamer TimeRollingNamer }
type WallClocker ¶
type WallClocker struct { }
func (WallClocker) Now ¶
func (wc WallClocker) Now() time.Time
Click to show internal directories.
Click to hide internal directories.