 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
      Index ¶
- Variables
- func Close()
- func Critical(skip int, format string, v ...interface{})
- func Debug(format string, v ...interface{})
- func Debug2(message string, v ...interface{})
- func Error(skip int, format string, v ...interface{})
- func Error2(message string, v ...interface{})
- func Fatal(skip int, format string, v ...interface{})
- func Info(format string, v ...interface{})
- func Info2(message string, v ...interface{})
- func LogFilterHandler(maxLevel log15.Lvl, filters map[string]log15.Lvl, h log15.Handler) log15.Handler
- func NewLogWriter(log Logger, level Lvl, prefix string) io.Writer
- func ReadLoggingConfig(modes []string, logsPath string, cfg *ini.File)
- func Reload()
- func Stack(skip int) string
- func Trace(format string, v ...interface{})
- func Warn(format string, v ...interface{})
- func Warn2(message 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()
}
    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()
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()
}
    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()
func (*SysLogHandler) Init ¶
func (sw *SysLogHandler) Init() error
 Click to show internal directories. 
   Click to hide internal directories.