Documentation ¶
Index ¶
- Constants
- Variables
- func Close()
- func Debug(fmt string, args ...interface{})
- func Error(fmt string, args ...interface{})
- func Fatal(fmt string, args ...interface{})
- func Info(fmt string, args ...interface{})
- func Register(w Writer)
- func SetLayout(layout string)
- func SetLevel(lvl int)
- func SetupDefaultLogWithConf(lc LogConfig) (err error)
- func SetupLogInstanceWithConf(lc LogConfig, logger *Logger) (err error)
- func Trace(fmt string, args ...interface{})
- func Warn(fmt string, args ...interface{})
- type ConfConsoleWriter
- type ConfFileWriter
- type ConsoleWriter
- type FileWriter
- func (w *FileWriter) CreateLogFile() error
- func (w *FileWriter) Flush() error
- func (w *FileWriter) Init() error
- func (w *FileWriter) Rotate() error
- func (w *FileWriter) SetFileName(filename string)
- func (w *FileWriter) SetLogLevelCeil(ceil int)
- func (w *FileWriter) SetLogLevelFloor(floor int)
- func (w *FileWriter) SetPathPattern(pattern string) error
- func (w *FileWriter) Write(r *Record) error
- type Flusher
- type LogConfig
- type Logger
- func (l *Logger) Close()
- func (l *Logger) Debug(fmt string, args ...interface{})
- func (l *Logger) Error(fmt string, args ...interface{})
- func (l *Logger) Fatal(fmt string, args ...interface{})
- func (l *Logger) Info(fmt string, args ...interface{})
- func (l *Logger) Register(w Writer)
- func (l *Logger) SetLayout(layout string)
- func (l *Logger) SetLevel(lvl int)
- func (l *Logger) Trace(fmt string, args ...interface{})
- func (l *Logger) Warn(fmt string, args ...interface{})
- type Record
- type Rotater
- type Writer
Constants ¶
View Source
const ( TRACE = iota DEBUG INFO WARNING ERROR FATAL )
Variables ¶
View Source
var (
LEVEL_FLAGS = [...]string{"TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"}
)
Functions ¶
func SetupDefaultLogWithConf ¶
Types ¶
type ConfConsoleWriter ¶
type ConfFileWriter ¶
type ConsoleWriter ¶
type ConsoleWriter struct {
// contains filtered or unexported fields
}
func NewConsoleWriter ¶
func NewConsoleWriter() *ConsoleWriter
func (*ConsoleWriter) Init ¶
func (w *ConsoleWriter) Init() error
func (*ConsoleWriter) SetColor ¶
func (w *ConsoleWriter) SetColor(c bool)
func (*ConsoleWriter) Write ¶
func (w *ConsoleWriter) Write(r *Record) error
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
func NewFileWriter ¶
func NewFileWriter() *FileWriter
func (*FileWriter) CreateLogFile ¶
func (w *FileWriter) CreateLogFile() error
func (*FileWriter) Flush ¶
func (w *FileWriter) Flush() error
func (*FileWriter) Init ¶
func (w *FileWriter) Init() error
func (*FileWriter) Rotate ¶
func (w *FileWriter) Rotate() error
func (*FileWriter) SetFileName ¶
func (w *FileWriter) SetFileName(filename string)
func (*FileWriter) SetLogLevelCeil ¶
func (w *FileWriter) SetLogLevelCeil(ceil int)
func (*FileWriter) SetLogLevelFloor ¶
func (w *FileWriter) SetLogLevelFloor(floor int)
func (*FileWriter) SetPathPattern ¶
func (w *FileWriter) SetPathPattern(pattern string) error
func (*FileWriter) Write ¶
func (w *FileWriter) Write(r *Record) error
type LogConfig ¶
type LogConfig struct { Level string `toml:"LogLevel"` FW ConfFileWriter `toml:"FileWriter"` CW ConfConsoleWriter `toml:"ConsoleWriter"` }
Click to show internal directories.
Click to hide internal directories.