Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIntLevel(level int32) bool
- func Debug(msg string, fields ...Field)
- func DebugC(ctx context.Context, msg string, fields ...Field)
- func Debugf(format string, v ...interface{})
- func DebugfC(ctx context.Context, format string, v ...interface{})
- func Debugw(msg string, keysAndValues ...interface{})
- func DebugwC(ctx context.Context, msg string, keysAndValues ...interface{})
- func Error(msg string, fields ...Field)
- func ErrorC(ctx context.Context, msg string, fields ...Field)
- func Errorf(format string, v ...interface{})
- func ErrorfC(ctx context.Context, format string, v ...interface{})
- func Fatal(msg string, fields ...Field)
- func FatalC(ctx context.Context, msg string, fields ...Field)
- func Fatalf(format string, v ...interface{})
- func FatalfC(ctx context.Context, format string, v ...interface{})
- func Flush()
- func Info(msg string, fields ...Field)
- func InfoC(ctx context.Context, msg string, fields ...Field)
- func Infof(format string, v ...interface{})
- func InfofC(ctx context.Context, format string, v ...interface{})
- func Init(opts *Options)
- func Panic(msg string, fields ...Field)
- func PanicC(ctx context.Context, msg string, fields ...Field)
- func Panicf(format string, v ...interface{})
- func PanicfC(ctx context.Context, format string, v ...interface{})
- func StdInfoLogger() *stdlog.Logger
- func Version() string
- func Warn(msg string, fields ...Field)
- func WarnC(ctx context.Context, msg string, fields ...Field)
- func Warnf(format string, v ...interface{})
- func WarnfC(ctx context.Context, format string, v ...interface{})
- func ZapLogger() *zap.Logger
- type Field
- type Level
- type LogHelper
- type Logger
- func (l *Logger) Clone(opts ...Option) *Logger
- func (l *Logger) Ctx(ctx context.Context) LoggerWithCtx
- func (l *Logger) DPanicContext(ctx context.Context, msg string, fields ...zapcore.Field)
- func (l *Logger) DPanicfContext(ctx context.Context, format string, v ...interface{})
- func (l *Logger) DebugContext(ctx context.Context, msg string, fields ...zapcore.Field)
- func (l *Logger) DebugfContext(ctx context.Context, format string, v ...interface{})
- func (l *Logger) DebugwContext(ctx context.Context, format string, v ...interface{})
- func (l *Logger) ErrorContext(ctx context.Context, msg string, fields ...zapcore.Field)
- func (l *Logger) ErrorfContext(ctx context.Context, format string, v ...interface{})
- func (l *Logger) FatalContext(ctx context.Context, msg string, fields ...zapcore.Field)
- func (l *Logger) FatalfContext(ctx context.Context, format string, v ...interface{})
- func (l *Logger) Flush()
- func (l *Logger) InfoContext(ctx context.Context, msg string, fields ...zapcore.Field)
- func (l *Logger) InfofContext(ctx context.Context, format string, v ...interface{})
- func (l *Logger) PanicContext(ctx context.Context, msg string, fields ...zapcore.Field)
- func (l *Logger) PanicfContext(ctx context.Context, format string, v ...interface{})
- func (l *Logger) Sugar() *SugaredLogger
- func (l *Logger) WarnContext(ctx context.Context, msg string, fields ...zapcore.Field)
- func (l *Logger) WarnfContext(ctx context.Context, format string, v ...interface{})
- func (l *Logger) WithOptions(opts ...zap.Option) *Logger
- type LoggerWithCtx
- func (l LoggerWithCtx) Clone() LoggerWithCtx
- func (l LoggerWithCtx) Context() context.Context
- func (l LoggerWithCtx) DPanic(msg string, fields ...zapcore.Field)
- func (l LoggerWithCtx) Debug(msg string, fields ...zapcore.Field)
- func (l LoggerWithCtx) Error(msg string, fields ...zapcore.Field)
- func (l LoggerWithCtx) Fatal(msg string, fields ...zapcore.Field)
- func (l LoggerWithCtx) Info(msg string, fields ...zapcore.Field)
- func (l LoggerWithCtx) Logger() *Logger
- func (l LoggerWithCtx) Panic(msg string, fields ...zapcore.Field)
- func (l LoggerWithCtx) Sugar() SugaredLoggerWithCtx
- func (l LoggerWithCtx) Warn(msg string, fields ...zapcore.Field)
- func (l LoggerWithCtx) WithOptions(opts ...zap.Option) LoggerWithCtx
- func (l LoggerWithCtx) ZapLogger() *zap.Logger
- type Option
- type Options
- type SugaredLogger
- func (s *SugaredLogger) Ctx(ctx context.Context) SugaredLoggerWithCtx
- func (s *SugaredLogger) DPanicfContext(ctx context.Context, template string, args ...interface{})
- func (s *SugaredLogger) DPanicwContext(ctx context.Context, msg string, keysAndValues ...interface{})
- func (s *SugaredLogger) DebugfContext(ctx context.Context, template string, args ...interface{})
- func (s *SugaredLogger) DebugwContext(ctx context.Context, msg string, keysAndValues ...interface{})
- func (s *SugaredLogger) Desugar() *Logger
- func (s *SugaredLogger) ErrorfContext(ctx context.Context, template string, args ...interface{})
- func (s *SugaredLogger) ErrorwContext(ctx context.Context, msg string, keysAndValues ...interface{})
- func (s *SugaredLogger) FatalfContext(ctx context.Context, template string, args ...interface{})
- func (s *SugaredLogger) FatalwContext(ctx context.Context, msg string, keysAndValues ...interface{})
- func (s *SugaredLogger) InfofContext(ctx context.Context, template string, args ...interface{})
- func (s *SugaredLogger) InfowContext(ctx context.Context, msg string, keysAndValues ...interface{})
- func (s *SugaredLogger) PanicfContext(ctx context.Context, template string, args ...interface{})
- func (s *SugaredLogger) PanicwContext(ctx context.Context, msg string, keysAndValues ...interface{})
- func (s *SugaredLogger) WarnfContext(ctx context.Context, template string, args ...interface{})
- func (s *SugaredLogger) WarnwContext(ctx context.Context, msg string, keysAndValues ...interface{})
- func (s *SugaredLogger) With(args ...interface{}) *SugaredLogger
- type SugaredLoggerWithCtx
- func (s SugaredLoggerWithCtx) DPanicf(template string, args ...interface{})
- func (s SugaredLoggerWithCtx) DPanicw(msg string, keysAndValues ...interface{})
- func (s SugaredLoggerWithCtx) Debugf(template string, args ...interface{})
- func (s SugaredLoggerWithCtx) Debugw(msg string, keysAndValues ...interface{})
- func (s SugaredLoggerWithCtx) Desugar() *Logger
- func (s SugaredLoggerWithCtx) Errorf(template string, args ...interface{})
- func (s SugaredLoggerWithCtx) Errorw(msg string, keysAndValues ...interface{})
- func (s SugaredLoggerWithCtx) Fatalf(template string, args ...interface{})
- func (s SugaredLoggerWithCtx) Fatalw(msg string, keysAndValues ...interface{})
- func (s SugaredLoggerWithCtx) Infof(template string, args ...interface{})
- func (s SugaredLoggerWithCtx) Infow(msg string, keysAndValues ...interface{})
- func (s SugaredLoggerWithCtx) Panicf(template string, args ...interface{})
- func (s SugaredLoggerWithCtx) Panicw(msg string, keysAndValues ...interface{})
- func (s SugaredLoggerWithCtx) Warnf(template string, args ...interface{})
- func (s SugaredLoggerWithCtx) Warnw(msg string, keysAndValues ...interface{})
Constants ¶
const ( KeyRequestID string = "requestID" KeyUsername string = "username" KeyUserID string = "userid" )
Defines common log fields.
Variables ¶
var ( // DebugLevel logs are typically voluminous, and are usually disabled in // production. DebugLevel = zapcore.DebugLevel // InfoLevel is the default logging priority. InfoLevel = zapcore.InfoLevel // WarnLevel logs are more important than Info, but don't need individual // human review. WarnLevel = zapcore.WarnLevel // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel = zapcore.ErrorLevel // PanicLevel logs a message, then panics. PanicLevel = zapcore.PanicLevel // FatalLevel logs a message, then calls os.Exit(1). FatalLevel = zapcore.FatalLevel )
var ( Any = zap.Any Array = zap.Array Object = zap.Object Binary = zap.Binary Bool = zap.Bool Bools = zap.Bools ByteString = zap.ByteString ByteStrings = zap.ByteStrings Complex64 = zap.Complex64 Complex64s = zap.Complex64s Complex128 = zap.Complex128 Complex128s = zap.Complex128s Duration = zap.Duration Durations = zap.Durations Err = zap.Error Errors = zap.Errors Float32 = zap.Float32 Float32s = zap.Float32s Float64 = zap.Float64 Float64s = zap.Float64s Int = zap.Int Ints = zap.Ints Int8 = zap.Int8 Int8s = zap.Int8s Int16 = zap.Int16 Int16s = zap.Int16s Int32 = zap.Int32 Int32s = zap.Int32s Int64 = zap.Int64 Int64s = zap.Int64s Namespace = zap.Namespace Reflect = zap.Reflect Stack = zap.Stack String = zap.String Stringer = zap.Stringer Strings = zap.Strings Time = zap.Time Times = zap.Times Uint = zap.Uint Uints = zap.Uints Uint8 = zap.Uint8 Uint8s = zap.Uint8s Uint16 = zap.Uint16 Uint16s = zap.Uint16s Uint32 = zap.Uint32 Uint32s = zap.Uint32s Uint64 = zap.Uint64 Uint64s = zap.Uint64s Uintptr = zap.Uintptr Uintptrs = zap.Uintptrs )
Alias for zap type functions.
Functions ¶
func CheckIntLevel ¶
CheckIntLevel used for other log wrapper such as klog which return if logging a message at the specified level is enabled.
func Debugw ¶
func Debugw(msg string, keysAndValues ...interface{})
Debugw method output debug level log.
func Panicf ¶
func Panicf(format string, v ...interface{})
Panicf method output panic level log and shutdown application.
func StdInfoLogger ¶
Types ¶
type Logger ¶
Logger 是 zap.Logger 的轻量封装, 它结合 Ctx 添加了相关链路追踪的方法
func (*Logger) Ctx ¶
func (l *Logger) Ctx(ctx context.Context) LoggerWithCtx
Ctx returns a new logger with the context.
func (*Logger) DPanicContext ¶
func (*Logger) DPanicfContext ¶
func (*Logger) DebugContext ¶
func (*Logger) DebugfContext ¶
func (*Logger) DebugwContext ¶
func (*Logger) ErrorContext ¶
func (*Logger) ErrorfContext ¶
func (*Logger) FatalContext ¶
func (*Logger) FatalfContext ¶
func (*Logger) InfoContext ¶
func (*Logger) InfofContext ¶
func (*Logger) PanicContext ¶
func (*Logger) PanicfContext ¶
func (*Logger) Sugar ¶
func (l *Logger) Sugar() *SugaredLogger
Sugar 包装了 Logger,提供了一个更符合人体工程学的、但稍微慢一些的 API 对 Logger 进行 Sugaring 的成本相当低廉, 因此在对性能敏感的代码边界上,在单个应用程序中使用 Logger 和 SugaredLogger 并在它们之间进行转换是合理的
func (*Logger) WarnContext ¶
func (*Logger) WarnfContext ¶
type LoggerWithCtx ¶
type LoggerWithCtx struct {
// contains filtered or unexported fields
}
LoggerWithCtx is a wrapper for Logger that also carries a context.Context.
func (LoggerWithCtx) Clone ¶
func (l LoggerWithCtx) Clone() LoggerWithCtx
Clone 方法克隆当前的日志记录器,并应用提供的选项
func (LoggerWithCtx) Context ¶
func (l LoggerWithCtx) Context() context.Context
Context returns logger's context.
func (LoggerWithCtx) DPanic ¶
func (l LoggerWithCtx) DPanic(msg string, fields ...zapcore.Field)
DPanic logs a message at DPanicLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
If the logger is in development mode, it then panics (DPanic means "development panic"). This is useful for catching errors that are recoverable, but shouldn't ever happen.
func (LoggerWithCtx) Debug ¶
func (l LoggerWithCtx) Debug(msg string, fields ...zapcore.Field)
Debug logs a message at DebugLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
func (LoggerWithCtx) Error ¶
func (l LoggerWithCtx) Error(msg string, fields ...zapcore.Field)
Error logs a message at ErrorLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
func (LoggerWithCtx) Fatal ¶
func (l LoggerWithCtx) Fatal(msg string, fields ...zapcore.Field)
Fatal logs a message at FatalLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
The logger then calls os.Exit(1), even if logging at FatalLevel is disabled.
func (LoggerWithCtx) Info ¶
func (l LoggerWithCtx) Info(msg string, fields ...zapcore.Field)
Info logs a message at InfoLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
func (LoggerWithCtx) Logger ¶
func (l LoggerWithCtx) Logger() *Logger
Logger returns the underlying logger.
func (LoggerWithCtx) Panic ¶
func (l LoggerWithCtx) Panic(msg string, fields ...zapcore.Field)
Panic logs a message at PanicLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
The logger then panics, even if logging at PanicLevel is disabled.
func (LoggerWithCtx) Sugar ¶
func (l LoggerWithCtx) Sugar() SugaredLoggerWithCtx
Sugar returns a sugared logger with the context.
func (LoggerWithCtx) Warn ¶
func (l LoggerWithCtx) Warn(msg string, fields ...zapcore.Field)
Warn logs a message at WarnLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
func (LoggerWithCtx) WithOptions ¶
func (l LoggerWithCtx) WithOptions(opts ...zap.Option) LoggerWithCtx
WithOptions clones the current Logger, applies the supplied Options, and returns the resulting Logger. It's safe to use concurrently.
func (LoggerWithCtx) ZapLogger ¶
func (l LoggerWithCtx) ZapLogger() *zap.Logger
ZapLogger returns the underlying zap logger.
type Option ¶
type Option func(l *Logger)
func WithCaller ¶
WithCaller configures the logger to annotate each event with the filename, line number, and function name of the caller.
It is enabled by default.
func WithErrorStatusLevel ¶
WithErrorStatusLevel sets the minimal zap logging level on which the span status is set to codes.Error.
The default is >= zap.ErrorLevel.
func WithMinLevel ¶
WithMinLevel sets the minimal zap logging level on which the log message is recorded on the span.
The default is >= zap.WarnLevel.
func WithStackTrace ¶
WithStackTrace configures the logger to capture logs with a stack trace.
func WithTraceIDField ¶
WithTraceIDField 配置日志记录器,以在结构化日志消息中添加 trace_id 字段。
此选项仅对不支持 OTLP 的后端有用,而是解析日志消息以提取结构化信息
type Options ¶
type Options struct { OutputPaths []string `json:"output-paths" mapstructure:"output-paths"` // OutputPaths 输出路径 ErrorOutputPaths []string `json:"error-output-paths" mapstructure:"error-output-paths"` // ErrorOutputPaths 错误输出路径 Level string `json:"level" mapstructure:"level"` // Level 运行 log 的 最低等级 Format string `json:"format" mapstructure:"format"` // Format 目前只有两种选择 console json DisableCaller bool `json:"disable-caller" mapstructure:"disable-caller"` // 默认情况下, 记录日志调用者(caller)的信息 如: "caller":"demo04/main.go:11" DisableStacktrace bool `json:"disable-stacktrace" mapstructure:"disable-stacktrace"` // 默认情况下, 禁用自动捕获堆栈跟踪 EnableColor bool `json:"enable-color" mapstructure:"enable-color"` // 为 true 时, Format = console 开启将Level序列化为全大写字符串并添加颜色。例如,InfoLevel被序列化为INFO,并被标记为蓝色 Development bool `json:"development" mapstructure:"development"` // Development 是否是开发模式 Name string `json:"name" mapstructure:"name"` // 底层 zap logger 的名字 EnableTraceID bool `json:"enable-trace-id" mapstructure:"enable-trace-id"` // EnableTraceID 是否开启traceID EnableTraceStack bool `json:"enable-trace-stack" mapstructure:"enable-trace-stack"` // EnableTraceStack 是否开启traceStack }
Options contains configuration items related to log.
func NewOptions ¶
func NewOptions() *Options
NewOptions 创建一个带有默认参数的 Options
@Description: @return *Options
type SugaredLogger ¶
type SugaredLogger struct { *zap.SugaredLogger // contains filtered or unexported fields }
SugaredLogger 在较慢但不太冗长的 API 中封装了基本 Logger 的功能。通过使用其 Sugar 方法,可以将任何 Logger 转换为 SugaredLogger。
与 Logger 不同,SugaredLogger 不坚持于结构化日志。对于每个日志级别,它提供三种方法:一种用于松散类型的结构化日志,一种用于 println 风格的格式化, 以及一种用于 printf 风格的格式化。例如,SugaredLoggers 可以使用 Infow("info with" 结构化上下文),Info 或 Infof 生成 InfoLevel 输出。
func (*SugaredLogger) Ctx ¶
func (s *SugaredLogger) Ctx(ctx context.Context) SugaredLoggerWithCtx
Ctx returns a new sugared logger with the context.
func (*SugaredLogger) DPanicfContext ¶
func (s *SugaredLogger) DPanicfContext(ctx context.Context, template string, args ...interface{})
DPanicfContext uses fmt.Sprintf to log a templated message. In development, the logger then panics. (See DPanicLevel for details.)
func (*SugaredLogger) DPanicwContext ¶
func (s *SugaredLogger) DPanicwContext( ctx context.Context, msg string, keysAndValues ...interface{}, )
DPanicwContext logs a message with some additional context. In development, the logger then panics. (See DPanicLevel for details.) The variadic key-value pairs are treated as they are in With.
func (*SugaredLogger) DebugfContext ¶
func (s *SugaredLogger) DebugfContext(ctx context.Context, template string, args ...interface{})
DebugfContext uses fmt.Sprintf to log a templated message.
func (*SugaredLogger) DebugwContext ¶
func (s *SugaredLogger) DebugwContext(ctx context.Context, msg string, keysAndValues ...interface{})
DebugwContext logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
func (*SugaredLogger) Desugar ¶
func (s *SugaredLogger) Desugar() *Logger
Desugar 方法解包 SugaredLogger,暴露原始的 Logger。 Desugaring 是比较廉价的,因此在性能敏感的代码边界, 单个应用程序可以同时使用 Loggers 和 SugaredLoggers,在它们之间进行转换是合理的
func (*SugaredLogger) ErrorfContext ¶
func (s *SugaredLogger) ErrorfContext(ctx context.Context, template string, args ...interface{})
ErrorfContext uses fmt.Sprintf to log a templated message.
func (*SugaredLogger) ErrorwContext ¶
func (s *SugaredLogger) ErrorwContext( ctx context.Context, msg string, keysAndValues ...interface{}, )
ErrorwContext logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
func (*SugaredLogger) FatalfContext ¶
func (s *SugaredLogger) FatalfContext(ctx context.Context, template string, args ...interface{})
Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
func (*SugaredLogger) FatalwContext ¶
func (s *SugaredLogger) FatalwContext(ctx context.Context, msg string, keysAndValues ...interface{})
FatalwContext logs a message with some additional context, then calls os.Exit. The variadic key-value pairs are treated as they are in With.
func (*SugaredLogger) InfofContext ¶
func (s *SugaredLogger) InfofContext(ctx context.Context, template string, args ...interface{})
InfofContext uses fmt.Sprintf to log a templated message.
func (*SugaredLogger) InfowContext ¶
func (s *SugaredLogger) InfowContext(ctx context.Context, msg string, keysAndValues ...interface{})
InfowContext logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
func (*SugaredLogger) PanicfContext ¶
func (s *SugaredLogger) PanicfContext(ctx context.Context, template string, args ...interface{})
PanicfContext uses fmt.Sprintf to log a templated message, then panics.
func (*SugaredLogger) PanicwContext ¶
func (s *SugaredLogger) PanicwContext(ctx context.Context, msg string, keysAndValues ...interface{})
PanicwContext logs a message with some additional context, then panics. The variadic key-value pairs are treated as they are in With.
func (*SugaredLogger) WarnfContext ¶
func (s *SugaredLogger) WarnfContext(ctx context.Context, template string, args ...interface{})
WarnfContext uses fmt.Sprintf to log a templated message.
func (*SugaredLogger) WarnwContext ¶
func (s *SugaredLogger) WarnwContext(ctx context.Context, msg string, keysAndValues ...interface{})
WarnwContext logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
func (*SugaredLogger) With ¶
func (s *SugaredLogger) With(args ...interface{}) *SugaredLogger
With adds a variadic number of fields to the logging context. It accepts a mix of strongly-typed Field objects and loosely-typed key-value pairs. When processing pairs, the first element of the pair is used as the field key and the second as the field value.
For example,
sugaredLogger.With( "hello", "world", "failure", errors.New("oh no"), Stack(), "count", 42, "user", User{Name: "alice"}, )
is the equivalent of
unsugared.With( String("hello", "world"), String("failure", "oh no"), Stack(), Int("count", 42), Object("user", User{Name: "alice"}), )
Note that the keys in key-value pairs should be strings. In development, passing a non-string key panics. In production, the logger is more forgiving: a separate error is logged, but the key-value pair is skipped and execution continues. Passing an orphaned key triggers similar behavior: panics in development and errors in production.
type SugaredLoggerWithCtx ¶
type SugaredLoggerWithCtx struct {
// contains filtered or unexported fields
}
func (SugaredLoggerWithCtx) DPanicf ¶
func (s SugaredLoggerWithCtx) DPanicf(template string, args ...interface{})
DPanicf uses fmt.Sprintf to log a templated message. In development, the logger then panics. (See DPanicLevel for details.)
func (SugaredLoggerWithCtx) DPanicw ¶
func (s SugaredLoggerWithCtx) DPanicw(msg string, keysAndValues ...interface{})
DPanicw logs a message with some additional context. In development, the logger then panics. (See DPanicLevel for details.) The variadic key-value pairs are treated as they are in With.
func (SugaredLoggerWithCtx) Debugf ¶
func (s SugaredLoggerWithCtx) Debugf(template string, args ...interface{})
Debugf uses fmt.Sprintf to log a templated message.
func (SugaredLoggerWithCtx) Debugw ¶
func (s SugaredLoggerWithCtx) Debugw(msg string, keysAndValues ...interface{})
Debugw logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
When debug-level logging is disabled, this is much faster than
s.With(keysAndValues).Debug(msg)
func (SugaredLoggerWithCtx) Desugar ¶
func (s SugaredLoggerWithCtx) Desugar() *Logger
Desugar 方法解包 SugaredLogger,暴露原始的 Logger。 Desugaring 是比较廉价的,因此在性能敏感的代码边界, 单个应用程序可以同时使用 Loggers 和 SugaredLoggers,在它们之间进行转换是合理的
func (SugaredLoggerWithCtx) Errorf ¶
func (s SugaredLoggerWithCtx) Errorf(template string, args ...interface{})
Errorf uses fmt.Sprintf to log a templated message.
func (SugaredLoggerWithCtx) Errorw ¶
func (s SugaredLoggerWithCtx) Errorw(msg string, keysAndValues ...interface{})
Errorw logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
func (SugaredLoggerWithCtx) Fatalf ¶
func (s SugaredLoggerWithCtx) Fatalf(template string, args ...interface{})
Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
func (SugaredLoggerWithCtx) Fatalw ¶
func (s SugaredLoggerWithCtx) Fatalw(msg string, keysAndValues ...interface{})
Fatalw logs a message with some additional context, then calls os.Exit. The variadic key-value pairs are treated as they are in With.
func (SugaredLoggerWithCtx) Infof ¶
func (s SugaredLoggerWithCtx) Infof(template string, args ...interface{})
Infof uses fmt.Sprintf to log a templated message.
func (SugaredLoggerWithCtx) Infow ¶
func (s SugaredLoggerWithCtx) Infow(msg string, keysAndValues ...interface{})
Infow logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
func (SugaredLoggerWithCtx) Panicf ¶
func (s SugaredLoggerWithCtx) Panicf(template string, args ...interface{})
Panicf uses fmt.Sprintf to log a templated message, then panics.
func (SugaredLoggerWithCtx) Panicw ¶
func (s SugaredLoggerWithCtx) Panicw(msg string, keysAndValues ...interface{})
Panicw logs a message with some additional context, then panics. The variadic key-value pairs are treated as they are in With.
func (SugaredLoggerWithCtx) Warnf ¶
func (s SugaredLoggerWithCtx) Warnf(template string, args ...interface{})
Warnf uses fmt.Sprintf to log a templated message.
func (SugaredLoggerWithCtx) Warnw ¶
func (s SugaredLoggerWithCtx) Warnw(msg string, keysAndValues ...interface{})
Warnw logs a message with some additional context. The variadic key-value pairs are treated as they are in With.