Documentation
¶
Index ¶
- Variables
- type Level
- type Logger
- type SampleLogger
- func (d *SampleLogger) Debug(ctx context.Context, module string, v ...interface{})
- func (d *SampleLogger) Debugf(ctx context.Context, module string, format string, v ...interface{})
- func (d *SampleLogger) Error(ctx context.Context, module string, v ...interface{})
- func (d *SampleLogger) Errorf(ctx context.Context, module string, format string, v ...interface{})
- func (d *SampleLogger) Info(ctx context.Context, module string, v ...interface{})
- func (d *SampleLogger) Infof(ctx context.Context, module string, format string, v ...interface{})
- func (d *SampleLogger) Level() Level
- func (d *SampleLogger) SetLevel(level Level)
- func (d *SampleLogger) Warn(ctx context.Context, module string, v ...interface{})
- func (d *SampleLogger) Warnf(ctx context.Context, module string, format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLogger = NewDefaultLogger(defaultLogLevel)
View Source
var (
DiscardLogger = &discardLogger{}
)
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
Debug(ctx context.Context, module string, v ...interface{})
Debugf(ctx context.Context, module string, format string, v ...interface{})
Error(ctx context.Context, module string, v ...interface{})
Errorf(ctx context.Context, module string, format string, v ...interface{})
Info(ctx context.Context, module string, v ...interface{})
Infof(ctx context.Context, module string, format string, v ...interface{})
Warn(ctx context.Context, module string, v ...interface{})
Warnf(ctx context.Context, module string, format string, v ...interface{})
Level() Level
SetLevel(level Level)
}
@brief Logger interface,implement this interface to output logs to your logging component
@since v0.7.0
type SampleLogger ¶ added in v0.8.0
type SampleLogger struct {
DEBUG *log.Logger
ERROR *log.Logger
INFO *log.Logger
WARN *log.Logger
// contains filtered or unexported fields
}
func NewDefaultLogger ¶
func NewDefaultLogger(level Level) *SampleLogger
@brief Creates a default logger with the specified log level
@param level Log level. See Level for details.
@since v0.7.0
func (*SampleLogger) Debug ¶ added in v0.8.0
func (d *SampleLogger) Debug(ctx context.Context, module string, v ...interface{})
func (*SampleLogger) Debugf ¶ added in v0.8.0
func (d *SampleLogger) Debugf(ctx context.Context, module string, format string, v ...interface{})
func (*SampleLogger) Error ¶ added in v0.8.0
func (d *SampleLogger) Error(ctx context.Context, module string, v ...interface{})
func (*SampleLogger) Errorf ¶ added in v0.8.0
func (d *SampleLogger) Errorf(ctx context.Context, module string, format string, v ...interface{})
func (*SampleLogger) Info ¶ added in v0.8.0
func (d *SampleLogger) Info(ctx context.Context, module string, v ...interface{})
func (*SampleLogger) Infof ¶ added in v0.8.0
func (d *SampleLogger) Infof(ctx context.Context, module string, format string, v ...interface{})
func (*SampleLogger) Level ¶ added in v0.8.0
func (d *SampleLogger) Level() Level
func (*SampleLogger) SetLevel ¶ added in v0.8.0
func (d *SampleLogger) SetLevel(level Level)
Click to show internal directories.
Click to hide internal directories.