Documentation
¶
Index ¶
- Variables
- type DefaultLoggerContext
- func (c *DefaultLoggerContext) LogDebug(args ...interface{})
- func (c *DefaultLoggerContext) LogDebugf(format string, args ...interface{})
- func (c *DefaultLoggerContext) LogError(args ...interface{})
- func (c *DefaultLoggerContext) LogErrorf(format string, args ...interface{})
- func (c *DefaultLoggerContext) LogFatal(args ...interface{})
- func (c *DefaultLoggerContext) LogFatalf(format string, args ...interface{})
- func (c *DefaultLoggerContext) LogInfo(args ...interface{})
- func (c *DefaultLoggerContext) LogInfof(format string, args ...interface{})
- func (c *DefaultLoggerContext) LogWarn(args ...interface{})
- func (c *DefaultLoggerContext) LogWarnf(format string, args ...interface{})
- func (c *DefaultLoggerContext) Logger(tags ...string) StdLogger
- type LoggerContext
- type PrefixLogger
- type StdLogger
- type StdLoggerWrapper
- func (w *StdLoggerWrapper) Debug(args ...interface{})
- func (w *StdLoggerWrapper) Debugf(format string, args ...interface{})
- func (w *StdLoggerWrapper) Error(args ...interface{})
- func (w *StdLoggerWrapper) Errorf(format string, args ...interface{})
- func (w *StdLoggerWrapper) Fatal(args ...interface{})
- func (w *StdLoggerWrapper) Fatalf(format string, args ...interface{})
- func (w *StdLoggerWrapper) Info(args ...interface{})
- func (w *StdLoggerWrapper) Infof(format string, args ...interface{})
- func (w *StdLoggerWrapper) Warn(args ...interface{})
- func (w *StdLoggerWrapper) Warnf(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var Console = &console{}
View Source
var Logger func(ctx context.Context, tags ...string) StdLogger
获取一个标准的 Logger 接口
Functions ¶
This section is empty.
Types ¶
type DefaultLoggerContext ¶
默认的 LoggerContext 版本
func NewDefaultLoggerContext ¶
func NewDefaultLoggerContext(ctx context.Context) *DefaultLoggerContext
工厂函数
func (*DefaultLoggerContext) LogDebug ¶
func (c *DefaultLoggerContext) LogDebug(args ...interface{})
func (*DefaultLoggerContext) LogDebugf ¶
func (c *DefaultLoggerContext) LogDebugf(format string, args ...interface{})
func (*DefaultLoggerContext) LogError ¶
func (c *DefaultLoggerContext) LogError(args ...interface{})
func (*DefaultLoggerContext) LogErrorf ¶
func (c *DefaultLoggerContext) LogErrorf(format string, args ...interface{})
func (*DefaultLoggerContext) LogFatal ¶
func (c *DefaultLoggerContext) LogFatal(args ...interface{})
func (*DefaultLoggerContext) LogFatalf ¶
func (c *DefaultLoggerContext) LogFatalf(format string, args ...interface{})
func (*DefaultLoggerContext) LogInfo ¶
func (c *DefaultLoggerContext) LogInfo(args ...interface{})
func (*DefaultLoggerContext) LogInfof ¶
func (c *DefaultLoggerContext) LogInfof(format string, args ...interface{})
func (*DefaultLoggerContext) LogWarn ¶
func (c *DefaultLoggerContext) LogWarn(args ...interface{})
func (*DefaultLoggerContext) LogWarnf ¶
func (c *DefaultLoggerContext) LogWarnf(format string, args ...interface{})
func (*DefaultLoggerContext) Logger ¶
func (c *DefaultLoggerContext) Logger(tags ...string) StdLogger
type LoggerContext ¶
type LoggerContext interface {
// 带有前缀的 Logger 接口
PrefixLogger
// 获取标准的 Context 对象
context.Context
// 获取一个标准的 Logger 接口
Logger(tags ...string) StdLogger
}
带有 Logger 功能的 context.Context 接口
type PrefixLogger ¶
type PrefixLogger interface {
LogDebug(args ...interface{})
LogDebugf(format string, args ...interface{})
LogInfo(args ...interface{})
LogInfof(format string, args ...interface{})
LogWarn(args ...interface{})
LogWarnf(format string, args ...interface{})
LogError(args ...interface{})
LogErrorf(format string, args ...interface{})
LogFatal(args ...interface{})
LogFatalf(format string, args ...interface{})
}
带前缀名的 Logger 接口
type StdLogger ¶
type StdLogger interface {
Debug(args ...interface{})
Debugf(format string, args ...interface{})
Info(args ...interface{})
Infof(format string, args ...interface{})
Warn(args ...interface{})
Warnf(format string, args ...interface{})
Error(args ...interface{})
Errorf(format string, args ...interface{})
Fatal(args ...interface{})
Fatalf(format string, args ...interface{})
}
标准的 Logger 接口
type StdLoggerWrapper ¶
type StdLoggerWrapper struct {
// contains filtered or unexported fields
}
为了平衡调用栈的深度,增加一个 StdLogger 包装类
func (*StdLoggerWrapper) Debug ¶
func (w *StdLoggerWrapper) Debug(args ...interface{})
func (*StdLoggerWrapper) Debugf ¶
func (w *StdLoggerWrapper) Debugf(format string, args ...interface{})
func (*StdLoggerWrapper) Error ¶
func (w *StdLoggerWrapper) Error(args ...interface{})
func (*StdLoggerWrapper) Errorf ¶
func (w *StdLoggerWrapper) Errorf(format string, args ...interface{})
func (*StdLoggerWrapper) Fatal ¶
func (w *StdLoggerWrapper) Fatal(args ...interface{})
func (*StdLoggerWrapper) Fatalf ¶
func (w *StdLoggerWrapper) Fatalf(format string, args ...interface{})
func (*StdLoggerWrapper) Info ¶
func (w *StdLoggerWrapper) Info(args ...interface{})
func (*StdLoggerWrapper) Infof ¶
func (w *StdLoggerWrapper) Infof(format string, args ...interface{})
func (*StdLoggerWrapper) Warn ¶
func (w *StdLoggerWrapper) Warn(args ...interface{})
func (*StdLoggerWrapper) Warnf ¶
func (w *StdLoggerWrapper) Warnf(format string, args ...interface{})
Click to show internal directories.
Click to hide internal directories.