Documentation
¶
Index ¶
- Variables
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func InitLogger(w io.Writer)
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func SetLevel(level Level)
- func SetTraceIdFunc(fun func(ctx context.Context) string)
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func With() *logContext
- type Level
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicf(format string, args ...interface{})
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) SetTraceIdFunc(fun func(ctx context.Context) string)
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
- func (l *Logger) With() *logContext
Constants ¶
This section is empty.
Variables ¶
View Source
var TraceIDKey = "traceId"
Functions ¶
func InitLogger ¶
func SetTraceIdFunc ¶
Types ¶
type Level ¶
type Level int8
Level defines log levels.
const ( // DebugLevel defines debug log level. DebugLevel Level = iota // InfoLevel defines info log level. InfoLevel // WarnLevel defines warn log level. WarnLevel // ErrorLevel defines error log level. ErrorLevel // FatalLevel defines fatal log level. FatalLevel // PanicLevel defines panic log level. PanicLevel // NoLevel defines an absent log level. NoLevel // Disabled disables the logger. Disabled )
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger ...
func DefaultLogger ¶
func DefaultLogger() *Logger
func (*Logger) SetTraceIdFunc ¶
Click to show internal directories.
Click to hide internal directories.