Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = LogConfig{ Level: "debug", Pattern: production, Output: "stdout", LogRotate: LogRotate{ Filename: "app.log", MaxSize: 100, MaxBackups: 3, MaxAge: 7, Compress: true, }, }
Functions ¶
This section is empty.
Types ¶
type LogConfig ¶
type LogConfig struct {
Level string `yaml:"Level"`
Pattern string `yaml:"Pattern"`
Output string `yaml:"Output"`
LogRotate LogRotate `yaml:"LogRotate"`
}
LogConfig holds the configuration for the logger
type LogHTTPWriter ¶
func NewLogHTTPWriter ¶
func NewLogHTTPWriter(serverURL string, warnOnHttpErr bool) *LogHTTPWriter
type LogRotate ¶
type LogRotate struct {
Filename string `yaml:"Filename"`
MaxSize int `yaml:"MaxSize"`
MaxBackups int `yaml:"MaxBackups"`
MaxAge int `yaml:"MaxAge"`
Compress bool `yaml:"Compress"`
}
LogRotate holds the configuration for log rotation
type Logger ¶
type Logger interface {
Trace(message string, args ...interface{})
Debug(message string, args ...interface{})
Info(message string, args ...interface{})
Warn(message string, args ...interface{})
Error(message string, args ...interface{})
Fatal(message string, args ...interface{})
Panic(message string, args ...interface{})
Tracef(format string, args ...interface{})
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warnf(format string, args ...interface{})
Errorf(format string, args ...interface{})
Fatalf(format string, args ...interface{})
Panicf(format string, args ...interface{})
SetConfig(config LogConfig)
GetConfig() LogConfig
IsTraceEnabled() bool
IsDebugEnabled() bool
IsInfoEnabled() bool
IsWarnEnabled() bool
IsErrorEnabled() bool
IsFatalEnabled() bool
IsPanicEnabled() bool
}
Logger interface defines the logging methods
Click to show internal directories.
Click to hide internal directories.