Documentation
¶
Index ¶
- Constants
- func ApiErrorf(param, format string, args ...interface{})
- func ApiInfof(param, format string, args ...interface{})
- func Debug(msg string)
- func Debugf(format string, args ...interface{})
- func Error(msg string)
- func Errorf(format string, args ...interface{})
- func Info(msg string)
- func Infof(format string, args ...interface{})
- func InitLogger(c *Config)
- func Warn(msg string)
- func Warnf(format string, args ...interface{})
- type Config
- type LogKafka
- type Logger
Constants ¶
View Source
const TIMEFORMAT = "2006-01-02 15:04:05"
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
func InitLogger(c *Config)
Types ¶
type Config ¶
type Config struct {
Name string
Debug bool
KafkaAddr string
WriteKafka bool
LogFileDir string `json:"logFileDir"`
ErrorFileName string `json:"errorFileName"`
WarnFileName string `json:"warnFileName"`
InfoFileName string `json:"infoFileName"`
DebugFileName string `json:"debugFileName"`
MaxSize int `json:"maxSize"` // megabytes
MaxBackups int `json:"maxBackups"`
MaxAge int `json:"maxAge"` // days
}
type LogKafka ¶
type LogKafka struct {
Producer sarama.SyncProducer
Topic string
}
Click to show internal directories.
Click to hide internal directories.