Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultFileConfig = FileConfig{ Filename: "logs/test.log", MaxSize: 50, MaxAge: 30, MaxBackups: 10, LocalTime: true, Compress: true, } DefaultLogConfig = LogConfig{ LogLevel: logl.LevelDebug, WriterConfig: WriterConfig{ EnableStdout: true, EnableFile: true, FileConfig: DefaultFileConfig, }, } )
Functions ¶
Types ¶
type FileConfig ¶
type FileConfig struct { Filename string `json:"filename" yaml:"filename" toml:"filename"` MaxSize int `json:"max-size" yaml:"max-size" toml:"max-size"` MaxAge int `json:"max-age" yaml:"max-age" toml:"max-age"` MaxBackups int `json:"max-backups" yaml:"max-backups" toml:"max-backups"` LocalTime bool `json:"localtime" yaml:"localtime" toml:"localtime"` Compress bool `json:"compress" yaml:"compress" toml:"compress"` }
lumberjack.Logger
type LogConfig ¶
type LogConfig struct { LogLevel logl.Level `json:"log-level" yaml:"log-level" toml:"log-level"` WriterConfig WriterConfig `json:"writer-config" yaml:"writer-config" toml:"writer-config"` }
type LogWriter ¶
type LogWriter interface { io.WriteCloser Rotator }
func NewLogWriter ¶
func NewLogWriter(wc WriterConfig) LogWriter
type UnrepErrLogger ¶
type UnrepErrLogger struct {
// contains filtered or unexported fields
}
func NewUnrepErrLogger ¶
func NewUnrepErrLogger(logger logl.Logger) *UnrepErrLogger
func (*UnrepErrLogger) Flush ¶
func (p *UnrepErrLogger) Flush()
func (*UnrepErrLogger) LogError ¶
func (p *UnrepErrLogger) LogError(err error)
type UnrepRecordWriter ¶
type UnrepRecordWriter struct {
// contains filtered or unexported fields
}
do not repeat. Do not repeat handler Unrep - unrepeated, unrepeatable
func NewUnrepRecordWriter ¶
func NewUnrepRecordWriter(rw logl.RecordWriter) *UnrepRecordWriter
func (*UnrepRecordWriter) Flush ¶
func (p *UnrepRecordWriter) Flush() error
func (*UnrepRecordWriter) WriteRecord ¶
func (p *UnrepRecordWriter) WriteRecord(r *logl.Record) error
type WriterConfig ¶
type WriterConfig struct { EnableStdout bool `json:"enable-stdout" yaml:"enable-stdout" toml:"enable-stdout"` EnableFile bool `json:"enable-file" yaml:"enable-file" toml:"enable-file"` FileConfig FileConfig `json:"file-config" yaml:"file-config" toml:"file-config"` }
Click to show internal directories.
Click to hide internal directories.