Documentation ¶
Index ¶
- Constants
- Variables
- func ContextWithFields(parent context.Context, fields Fields) context.Context
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Fatalln(args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func Panicln(args ...interface{})
- func Print(args ...interface{})
- func Printf(format string, args ...interface{})
- func Println(args ...interface{})
- func SetDefaultFields(fields Fields)
- func SetFormatter(ftype Formatter)
- func SetLevel(level Level)
- func SetOutput(writer io.Writer)
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func Warnln(args ...interface{})
- type Fields
- type Formatter
- type Level
- type Logger
- type ServiceLogger
- func (l *ServiceLogger) Debug(args ...interface{})
- func (l *ServiceLogger) Debugf(format string, args ...interface{})
- func (l *ServiceLogger) Debugln(args ...interface{})
- func (l *ServiceLogger) Error(args ...interface{})
- func (l *ServiceLogger) Errorf(format string, args ...interface{})
- func (l *ServiceLogger) Errorln(args ...interface{})
- func (l *ServiceLogger) Fatal(args ...interface{})
- func (l *ServiceLogger) Fatalf(format string, args ...interface{})
- func (l *ServiceLogger) Fatalln(args ...interface{})
- func (l *ServiceLogger) GetLevel() Level
- func (l *ServiceLogger) Info(args ...interface{})
- func (l *ServiceLogger) Infof(format string, args ...interface{})
- func (l *ServiceLogger) Infoln(args ...interface{})
- func (l *ServiceLogger) Panic(args ...interface{})
- func (l *ServiceLogger) Panicf(format string, args ...interface{})
- func (l *ServiceLogger) Panicln(args ...interface{})
- func (l *ServiceLogger) Print(args ...interface{})
- func (l *ServiceLogger) Printf(format string, args ...interface{})
- func (l *ServiceLogger) Println(args ...interface{})
- func (l *ServiceLogger) SetFormatter(ftype Formatter)
- func (l *ServiceLogger) SetLevel(level Level)
- func (l *ServiceLogger) SetOutput(writer io.Writer)
- func (l *ServiceLogger) Warn(args ...interface{})
- func (l *ServiceLogger) Warnf(format string, args ...interface{})
- func (l *ServiceLogger) Warnln(args ...interface{})
- func (l *ServiceLogger) WithContext(ctx context.Context) *ServiceLogger
- func (l *ServiceLogger) WithError(err error) *ServiceLogger
- func (l *ServiceLogger) WithField(key string, value interface{}) *ServiceLogger
- func (l *ServiceLogger) WithFields(fields Fields) *ServiceLogger
Constants ¶
View Source
const ( PanicLevel = Level(logrus.PanicLevel) FatalLevel = Level(logrus.FatalLevel) ErrorLevel = Level(logrus.ErrorLevel) WarnLevel = Level(logrus.WarnLevel) InfoLevel = Level(logrus.InfoLevel) DebugLevel = Level(logrus.DebugLevel) )
Variables ¶
View Source
var ( DefaultLogger = newServiceLogger() NilLogger = newServiceLogger() )
Functions ¶
func ContextWithFields ¶
ContextWithFields adds logger fields to fields in context.
func SetDefaultFields ¶
func SetDefaultFields(fields Fields)
func SetFormatter ¶
func SetFormatter(ftype Formatter)
Types ¶
type Logger ¶
type Logger interface { WithField(key string, value interface{}) *ServiceLogger WithFields(fields Fields) *ServiceLogger WithError(err error) *ServiceLogger WithContext(ctx context.Context) *ServiceLogger Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Printf(format string, args ...interface{}) Warnf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Fatalf(format string, args ...interface{}) Panicf(format string, args ...interface{}) Debug(args ...interface{}) Info(args ...interface{}) Print(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Fatal(args ...interface{}) Panic(args ...interface{}) Debugln(args ...interface{}) Infoln(args ...interface{}) Println(args ...interface{}) Warnln(args ...interface{}) Errorln(args ...interface{}) Fatalln(args ...interface{}) Panicln(args ...interface{}) }
type ServiceLogger ¶
type ServiceLogger struct {
// contains filtered or unexported fields
}
func WithContext ¶
func WithContext(ctx context.Context) *ServiceLogger
func WithError ¶
func WithError(err error) *ServiceLogger
func WithField ¶
func WithField(key string, value interface{}) *ServiceLogger
func WithFields ¶
func WithFields(fields Fields) *ServiceLogger
func (*ServiceLogger) Debug ¶
func (l *ServiceLogger) Debug(args ...interface{})
func (*ServiceLogger) Debugf ¶
func (l *ServiceLogger) Debugf(format string, args ...interface{})
func (*ServiceLogger) Debugln ¶
func (l *ServiceLogger) Debugln(args ...interface{})
func (*ServiceLogger) Error ¶
func (l *ServiceLogger) Error(args ...interface{})
func (*ServiceLogger) Errorf ¶
func (l *ServiceLogger) Errorf(format string, args ...interface{})
func (*ServiceLogger) Errorln ¶
func (l *ServiceLogger) Errorln(args ...interface{})
func (*ServiceLogger) Fatal ¶
func (l *ServiceLogger) Fatal(args ...interface{})
func (*ServiceLogger) Fatalf ¶
func (l *ServiceLogger) Fatalf(format string, args ...interface{})
func (*ServiceLogger) Fatalln ¶
func (l *ServiceLogger) Fatalln(args ...interface{})
func (*ServiceLogger) GetLevel ¶
func (l *ServiceLogger) GetLevel() Level
func (*ServiceLogger) Info ¶
func (l *ServiceLogger) Info(args ...interface{})
func (*ServiceLogger) Infof ¶
func (l *ServiceLogger) Infof(format string, args ...interface{})
func (*ServiceLogger) Infoln ¶
func (l *ServiceLogger) Infoln(args ...interface{})
func (*ServiceLogger) Panic ¶
func (l *ServiceLogger) Panic(args ...interface{})
func (*ServiceLogger) Panicf ¶
func (l *ServiceLogger) Panicf(format string, args ...interface{})
func (*ServiceLogger) Panicln ¶
func (l *ServiceLogger) Panicln(args ...interface{})
func (*ServiceLogger) Print ¶
func (l *ServiceLogger) Print(args ...interface{})
func (*ServiceLogger) Printf ¶
func (l *ServiceLogger) Printf(format string, args ...interface{})
func (*ServiceLogger) Println ¶
func (l *ServiceLogger) Println(args ...interface{})
func (*ServiceLogger) SetFormatter ¶
func (l *ServiceLogger) SetFormatter(ftype Formatter)
func (*ServiceLogger) SetLevel ¶
func (l *ServiceLogger) SetLevel(level Level)
func (*ServiceLogger) SetOutput ¶
func (l *ServiceLogger) SetOutput(writer io.Writer)
func (*ServiceLogger) Warn ¶
func (l *ServiceLogger) Warn(args ...interface{})
func (*ServiceLogger) Warnf ¶
func (l *ServiceLogger) Warnf(format string, args ...interface{})
func (*ServiceLogger) Warnln ¶
func (l *ServiceLogger) Warnln(args ...interface{})
func (*ServiceLogger) WithContext ¶
func (l *ServiceLogger) WithContext(ctx context.Context) *ServiceLogger
func (*ServiceLogger) WithError ¶
func (l *ServiceLogger) WithError(err error) *ServiceLogger
func (*ServiceLogger) WithField ¶
func (l *ServiceLogger) WithField(key string, value interface{}) *ServiceLogger
func (*ServiceLogger) WithFields ¶
func (l *ServiceLogger) WithFields(fields Fields) *ServiceLogger
Click to show internal directories.
Click to hide internal directories.