Documentation ¶
Overview ¶
Package zap wraps uber zap package.
Index ¶
- type FastXLogger
- func (log *FastXLogger) AddCallerSkip(n int) xlogcore.FastXLog
- func (log *FastXLogger) Debug(msg string)
- func (log *FastXLogger) Error(msg string)
- func (log *FastXLogger) Fatal(msg string)
- func (log *FastXLogger) FromCtx(ctx context.Context) xlogcore.FastXLog
- func (log *FastXLogger) Info(msg string)
- func (log *FastXLogger) Panic(msg string)
- func (log *FastXLogger) Sync()
- func (log *FastXLogger) ToCtx(ctx context.Context, kvs ...xlogcore.KeyVal) context.Context
- func (log *FastXLogger) Warn(msg string)
- func (log *FastXLogger) With(kvs ...xlogcore.KeyVal) xlogcore.FastXLog
- func (log *FastXLogger) WithOptions(opts ...xlogcore.Option) xlogcore.FastXLog
- func (log *FastXLogger) XLog() xlogcore.XLog
- type XLogger
- func (log *XLogger) AddCallerSkip(n int) xlogcore.XLog
- func (log *XLogger) Debug(args ...interface{})
- func (log *XLogger) Debugf(tpl string, args ...interface{})
- func (log *XLogger) Error(args ...interface{})
- func (log *XLogger) Errorf(tpl string, args ...interface{})
- func (log *XLogger) Fast() xlogcore.FastXLog
- func (log *XLogger) Fatal(args ...interface{})
- func (log *XLogger) Fatalf(tpl string, args ...interface{})
- func (log *XLogger) FromCtx(ctx context.Context) xlogcore.XLog
- func (log *XLogger) Info(args ...interface{})
- func (log *XLogger) Infof(tpl string, args ...interface{})
- func (log *XLogger) Panic(args ...interface{})
- func (log *XLogger) Panicf(tpl string, args ...interface{})
- func (log *XLogger) Sync()
- func (log *XLogger) ToCtx(ctx context.Context, kvs ...interface{}) context.Context
- func (log *XLogger) Warn(args ...interface{})
- func (log *XLogger) Warnf(tpl string, args ...interface{})
- func (log *XLogger) With(kvs ...interface{}) xlogcore.XLog
- func (log *XLogger) WithOptions(opts ...xlogcore.Option) xlogcore.XLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FastXLogger ¶
type FastXLogger struct {
// contains filtered or unexported fields
}
XLogger wraps zap Logger.
func NewFastXLogger ¶
func NewFastXLogger(config xlogcore.Config) (*FastXLogger, error)
NewFastXLogger returns FastXLogger.
func (*FastXLogger) AddCallerSkip ¶
func (log *FastXLogger) AddCallerSkip(n int) xlogcore.FastXLog
AddCallerSkip increases the number of callers skipped by caller annotation.
func (*FastXLogger) Debug ¶
func (log *FastXLogger) Debug(msg string)
Debug construct and log a Debug message.
func (*FastXLogger) Error ¶
func (log *FastXLogger) Error(msg string)
Error construct and log a Error message.
func (*FastXLogger) Fatal ¶
func (log *FastXLogger) Fatal(msg string)
Fatal construct and log a Fatal message, then calls os.Exit(1).
func (*FastXLogger) FromCtx ¶
func (log *FastXLogger) FromCtx(ctx context.Context) xlogcore.FastXLog
FromCtx gets the FastXLog from the ctx.
func (*FastXLogger) Info ¶
func (log *FastXLogger) Info(msg string)
Info construct and log a Info message.
func (*FastXLogger) Panic ¶
func (log *FastXLogger) Panic(msg string)
Panic construct and log a Panic message, then panics.
func (*FastXLogger) Sync ¶
func (log *FastXLogger) Sync()
Sync flushes buffered logs. Users should call Sync before exiting.
func (*FastXLogger) ToCtx ¶
ToCtx adds the FastXLog, with a variadic number of fields, to ctx and returns the resulting context.Context.
func (*FastXLogger) Warn ¶
func (log *FastXLogger) Warn(msg string)
Warn construct and log a Warn message.
func (*FastXLogger) With ¶
func (log *FastXLogger) With(kvs ...xlogcore.KeyVal) xlogcore.FastXLog
With adds a variadic number of fields to the logging context.
func (*FastXLogger) WithOptions ¶
func (log *FastXLogger) WithOptions(opts ...xlogcore.Option) xlogcore.FastXLog
WithOptions clones the current Logger, applies the supplied Options, and returns the resulting Logger. It's safe to use concurrently.
func (*FastXLogger) XLog ¶
func (log *FastXLogger) XLog() xlogcore.XLog
XLog converting FastXLog to XLog. The operation is quite inexpensive.
type XLogger ¶
type XLogger struct {
// contains filtered or unexported fields
}
XLogger wraps zap SugaredLogger.
func NewXLogger ¶
NewXLogger returns XLogger.
func (*XLogger) AddCallerSkip ¶
AddCallerSkip increases the number of callers skipped by caller annotation.
func (*XLogger) Debug ¶
func (log *XLogger) Debug(args ...interface{})
Debug construct and log a Debug message.
func (*XLogger) Debugf ¶
Debugf construct and log a Debug message.
func (*XLogger) Error ¶
func (log *XLogger) Error(args ...interface{})
Error construct and log a Error message.
func (*XLogger) Errorf ¶
Errorf construct and log a Error message.
func (*XLogger) Fast ¶
Fast converting XLog to FastXLog. The operation is quite inexpensive.
func (*XLogger) Fatal ¶
func (log *XLogger) Fatal(args ...interface{})
Fatal construct and log a Fatal message, then calls os.Exit(1).
func (*XLogger) Fatalf ¶
Fatalf construct and log a Fatal message, then calls os.Exit(1).
func (*XLogger) FromCtx ¶
FromCtx gets the XLog from the ctx.
func (*XLogger) Info ¶
func (log *XLogger) Info(args ...interface{})
Info construct and log a Info message.
func (*XLogger) Infof ¶
Infof construct and log a Info message.
func (*XLogger) Panic ¶
func (log *XLogger) Panic(args ...interface{})
Panic construct and log a Panic message, then panics.
func (*XLogger) Panicf ¶
Panicf construct and log a Panic message, then panics.
func (*XLogger) Sync ¶
func (log *XLogger) Sync()
Sync flushes buffered logs. Users should call Sync before exiting.
func (*XLogger) ToCtx ¶
ToCtx adds the XLog, with a variadic number of fields, to ctx and returns the resulting context.Context.
func (*XLogger) Warn ¶
func (log *XLogger) Warn(args ...interface{})
Warn construct and log a Warn message.
func (*XLogger) Warnf ¶
Warnf construct and log a Warn message.
func (*XLogger) With ¶
With adds a variadic number of fields to the logging context.