Documentation
¶
Index ¶
- func AddHook(hook logrus.Hook)
- func Debug(args ...interface{})
- func Debugf(str string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(str string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(str string, args ...interface{})
- func Info(args ...interface{})
- func Infof(str string, args ...interface{})
- func Setting(option func(*Config))
- func Trace(args ...interface{})
- func Tracef(str string, args ...interface{})
- func Warn(args ...interface{})
- func Warnf(str string, args ...interface{})
- type Config
- type FileHook
- type IBaseLogger
- type ILogger
- type ILoggerRotate
- type LineHook
- type LoggerRotate
- type LogrusLogger
- func (l *LogrusLogger) AddHook(hook logrus.Hook)
- func (l *LogrusLogger) Data(v interface{}) IBaseLogger
- func (l *LogrusLogger) Debug(args ...interface{})
- func (l *LogrusLogger) Debugf(format string, args ...interface{})
- func (l *LogrusLogger) Error(args ...interface{})
- func (l *LogrusLogger) Errorf(format string, args ...interface{})
- func (l *LogrusLogger) Fatal(args ...interface{})
- func (l *LogrusLogger) Fatalf(format string, args ...interface{})
- func (l *LogrusLogger) Info(args ...interface{})
- func (l *LogrusLogger) Infof(format string, args ...interface{})
- func (l *LogrusLogger) Trace(args ...interface{})
- func (l *LogrusLogger) Tracef(format string, args ...interface{})
- func (l *LogrusLogger) Warn(args ...interface{})
- func (l *LogrusLogger) Warnf(format string, args ...interface{})
- func (l *LogrusLogger) WithFields(fields map[string]interface{}) IBaseLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
LogName string `toml:"log_name" json:"log_name"`
LogFormat string `toml:"log_format" json:"log_format"`
LogPath string `toml:"log_path" json:"log_path"`
LogMode string `toml:"log_mode" json:"log_mode"`
LogLevel string `toml:"log_level" json:"log_level"`
LogDetail bool `toml:"log_detail" json:"log_detail"`
LogMaxFiles int `toml:"log_max_files" json:"log_max_files"`
LogSentryDSN string `toml:"log_sentry_dsn" json:"log_sentry_dsn"`
LogSentryType string `toml:"log_sentry_type" json:"log_sentry_type"`
LogRotate ILoggerRotate
LogWriter io.Writer
}
type FileHook ¶
type FileHook struct {
// contains filtered or unexported fields
}
FileHook to send logs via syslog.
func NewFileHook ¶
type IBaseLogger ¶ added in v1.0.5
type IBaseLogger interface {
Fatalf(string, ...interface{})
Debugf(string, ...interface{})
Infof(string, ...interface{})
Warnf(string, ...interface{})
Errorf(string, ...interface{})
Tracef(string, ...interface{})
Fatal(...interface{})
Debug(...interface{})
Info(...interface{})
Warn(...interface{})
Error(...interface{})
Trace(...interface{})
}
ILogger is the logger interface
func Data ¶ added in v1.1.4
func Data(v interface{}) IBaseLogger
func WithFields ¶ added in v1.1.0
func WithFields(fields map[string]interface{}) IBaseLogger
type ILogger ¶
type ILogger interface {
IBaseLogger
AddHook(hook logrus.Hook)
WithFields(map[string]interface{}) IBaseLogger
Data(interface{}) IBaseLogger
}
ILogger is the logger interface
func NewLogrusLogger ¶
func NewLogrusLogger(option func(l *LogrusLogger)) ILogger
NewFileLogger providers a file logger based on logrus
type ILoggerRotate ¶ added in v1.1.0
type LineHook ¶
type LineHook struct {
// contains filtered or unexported fields
}
func NewLineHook ¶
type LoggerRotate ¶ added in v1.1.0
type LoggerRotate struct{}
func (*LoggerRotate) Current ¶ added in v1.1.0
func (r *LoggerRotate) Current() string
func (*LoggerRotate) Prev ¶ added in v1.1.0
func (r *LoggerRotate) Prev(n int) string
type LogrusLogger ¶
LogrusLogger file logger
func (*LogrusLogger) AddHook ¶ added in v1.0.5
func (l *LogrusLogger) AddHook(hook logrus.Hook)
func (*LogrusLogger) Data ¶ added in v1.1.4
func (l *LogrusLogger) Data(v interface{}) IBaseLogger
func (*LogrusLogger) Debug ¶
func (l *LogrusLogger) Debug(args ...interface{})
func (*LogrusLogger) Debugf ¶
func (l *LogrusLogger) Debugf(format string, args ...interface{})
func (*LogrusLogger) Error ¶
func (l *LogrusLogger) Error(args ...interface{})
func (*LogrusLogger) Errorf ¶
func (l *LogrusLogger) Errorf(format string, args ...interface{})
func (*LogrusLogger) Fatal ¶
func (l *LogrusLogger) Fatal(args ...interface{})
func (*LogrusLogger) Fatalf ¶
func (l *LogrusLogger) Fatalf(format string, args ...interface{})
func (*LogrusLogger) Info ¶
func (l *LogrusLogger) Info(args ...interface{})
func (*LogrusLogger) Infof ¶
func (l *LogrusLogger) Infof(format string, args ...interface{})
func (*LogrusLogger) Trace ¶ added in v1.0.2
func (l *LogrusLogger) Trace(args ...interface{})
func (*LogrusLogger) Tracef ¶ added in v1.0.2
func (l *LogrusLogger) Tracef(format string, args ...interface{})
func (*LogrusLogger) Warn ¶
func (l *LogrusLogger) Warn(args ...interface{})
func (*LogrusLogger) Warnf ¶
func (l *LogrusLogger) Warnf(format string, args ...interface{})
func (*LogrusLogger) WithFields ¶ added in v1.1.0
func (l *LogrusLogger) WithFields(fields map[string]interface{}) IBaseLogger
Click to show internal directories.
Click to hide internal directories.