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 Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func SetLogger(logger StdLogger)
- func Trace(args ...interface{})
- func Tracef(format string, args ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- type Console
- func (c *Console) Debug(args ...interface{})
- func (c *Console) Debugf(format string, args ...interface{})
- func (c *Console) Error(args ...interface{})
- func (c *Console) Errorf(format string, args ...interface{})
- func (c *Console) Fatal(args ...interface{})
- func (c *Console) Fatalf(format string, args ...interface{})
- func (c *Console) Info(args ...interface{})
- func (c *Console) Infof(format string, args ...interface{})
- func (c *Console) Panic(args ...interface{})
- func (c *Console) Panicf(format string, args ...interface{})
- func (c *Console) SetLevel(level Level)
- func (c *Console) Trace(args ...interface{})
- func (c *Console) Tracef(format string, args ...interface{})
- func (c *Console) Warn(args ...interface{})
- func (c *Console) Warnf(format string, args ...interface{})
- 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) LogPanic(args ...interface{})
- func (c *DefaultLoggerContext) LogPanicf(format string, args ...interface{})
- func (c *DefaultLoggerContext) LogTrace(args ...interface{})
- func (c *DefaultLoggerContext) LogTracef(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 Level
- 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) Panic(args ...interface{})
- func (w *StdLoggerWrapper) Panicf(format string, args ...interface{})
- func (w *StdLoggerWrapper) Trace(args ...interface{})
- func (w *StdLoggerWrapper) Tracef(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 Logger func(ctx context.Context, tags ...string) StdLogger
Logger 获取一个标准的 Logger 接口
Functions ¶
Types ¶
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console 将日志打印到控制台
type DefaultLoggerContext ¶
DefaultLoggerContext 默认的 LoggerContext 版本
func NewDefaultLoggerContext ¶
func NewDefaultLoggerContext(ctx context.Context) *DefaultLoggerContext
NewDefaultLoggerContext 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) LogPanic ¶
func (c *DefaultLoggerContext) LogPanic(args ...interface{})
func (*DefaultLoggerContext) LogPanicf ¶
func (c *DefaultLoggerContext) LogPanicf(format string, args ...interface{})
func (*DefaultLoggerContext) LogTrace ¶
func (c *DefaultLoggerContext) LogTrace(args ...interface{})
func (*DefaultLoggerContext) LogTracef ¶
func (c *DefaultLoggerContext) LogTracef(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
}
LoggerContext 带有 Logger 功能的 context.Context 接口
type PrefixLogger ¶
type PrefixLogger interface {
LogTrace(args ...interface{})
LogTracef(format string, args ...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{})
LogPanic(args ...interface{})
LogPanicf(format string, args ...interface{})
LogFatal(args ...interface{})
LogFatalf(format string, args ...interface{})
}
PrefixLogger 带前缀名的 Logger 接口
type StdLogger ¶
type StdLogger interface {
Trace(args ...interface{})
Tracef(format string, args ...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{})
Panic(args ...interface{})
Panicf(format string, args ...interface{})
Fatal(args ...interface{})
Fatalf(format string, args ...interface{})
}
StdLogger 标准的 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) Panic ¶
func (w *StdLoggerWrapper) Panic(args ...interface{})
func (*StdLoggerWrapper) Panicf ¶
func (w *StdLoggerWrapper) Panicf(format string, args ...interface{})
func (*StdLoggerWrapper) Trace ¶
func (w *StdLoggerWrapper) Trace(args ...interface{})
func (*StdLoggerWrapper) Tracef ¶
func (w *StdLoggerWrapper) Tracef(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.