Documentation ¶
Index ¶
- Variables
- func Close() error
- func Debugf(format string, v ...interface{})
- func Error(msg string, args ...interface{})
- func Errorf(skip int, format string, v ...interface{})
- func Fatalf(skip int, format string, v ...interface{})
- func Infof(format string, v ...interface{})
- func LogFilterHandler(maxLevel log15.Lvl, filters map[string]log15.Lvl, h log15.Handler) log15.Handler
- func ReadLoggingConfig(modes []string, logsPath string, cfg *ini.File) error
- func Reload() error
- func Stack(skip int) string
- func Tracef(format string, v ...interface{})
- func Warn(msg string, v ...interface{})
- func Warnf(format string, v ...interface{})
- type DisposableHandler
- type FileLogWriter
- type Logger
- type Lvl
- type MuxWriter
- type ReloadableHandler
- type SysLogHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var Root log15.Logger
Functions ¶
func LogFilterHandler ¶
func ReadLoggingConfig ¶
Types ¶
type DisposableHandler ¶
type DisposableHandler interface {
Close() error
}
type FileLogWriter ¶
type FileLogWriter struct { Format log15.Format Filename string Maxlines int // Rotate at size Maxsize int // Rotate daily Daily bool Maxdays int64 Rotate bool // contains filtered or unexported fields }
FileLogWriter implements LoggerInterface. It writes messages by lines limit, file size limit, or time frequency.
func NewFileWriter ¶
func NewFileWriter() *FileLogWriter
create a FileLogWriter returning as LoggerInterface.
func (*FileLogWriter) Close ¶
func (w *FileLogWriter) Close() error
destroy file logger, close file writer.
func (*FileLogWriter) DoRotate ¶
func (w *FileLogWriter) DoRotate() error
DoRotate means it need to write file in new file. new file name like xx.log.2013-01-01.2
func (*FileLogWriter) Flush ¶
func (w *FileLogWriter) Flush()
flush file logger. there are no buffering messages in file logger in memory. flush file means sync file from disk.
func (*FileLogWriter) Init ¶
func (w *FileLogWriter) Init() error
func (*FileLogWriter) StartLogger ¶
func (w *FileLogWriter) StartLogger() error
start file logger. create log file and set to locker-inside file writer.
type Logger ¶
type Logger interface { // New returns a new Logger that has this logger's context plus the given context New(ctx ...interface{}) log15.Logger // GetHandler gets the handler associated with the logger. GetHandler() log15.Handler // SetHandler updates the logger to write records to the specified handler. SetHandler(h log15.Handler) // Log a message at the given level with context key/value pairs Debug(msg string, ctx ...interface{}) Info(msg string, ctx ...interface{}) Warn(msg string, ctx ...interface{}) Error(msg string, ctx ...interface{}) Crit(msg string, ctx ...interface{}) }
type ReloadableHandler ¶
type ReloadableHandler interface {
Reload() error
}
type SysLogHandler ¶
type SysLogHandler struct { Network string Address string Facility string Tag string Format log15.Format // contains filtered or unexported fields }
func NewSyslog ¶
func NewSyslog(sec *ini.Section, format log15.Format) *SysLogHandler
func (*SysLogHandler) Close ¶
func (sw *SysLogHandler) Close() error
func (*SysLogHandler) Init ¶
func (sw *SysLogHandler) Init() error
Click to show internal directories.
Click to hide internal directories.