Documentation ¶
Index ¶
- func TracingParamsFromContext(ctx context.Context, params map[string]interface{}) map[string]interface{}
- func WithTracingParams(ctx context.Context, params map[string]interface{}) context.Context
- type LeafLogger
- type Logger
- type NoopLogger
- func (n *NoopLogger) AsSugaredLogger() *zap.SugaredLogger
- func (n *NoopLogger) Debug(args ...interface{})
- func (n *NoopLogger) Debugf(template string, args ...interface{})
- func (n *NoopLogger) Debugw(msg string, keysAndValues ...interface{})
- func (n *NoopLogger) Error(args ...interface{})
- func (n *NoopLogger) Errorf(template string, args ...interface{})
- func (n *NoopLogger) Errorw(msg string, keysAndValues ...interface{})
- func (n *NoopLogger) Info(args ...interface{})
- func (n *NoopLogger) Infof(template string, args ...interface{})
- func (n *NoopLogger) Infow(msg string, keysAndValues ...interface{})
- func (n *NoopLogger) Named(name string) Logger
- func (n *NoopLogger) SetLevel(levelStr string)
- func (n *NoopLogger) Sync() error
- func (n *NoopLogger) Warn(args ...interface{})
- func (n *NoopLogger) Warnf(template string, args ...interface{})
- func (n *NoopLogger) Warnw(msg string, keysAndValues ...interface{})
- func (n *NoopLogger) With(args ...interface{}) Logger
- func (n *NoopLogger) WithTracingParams(ctx context.Context) Logger
- type TracingProperties
- type ZapLogger
- func (z *ZapLogger) AsSugaredLogger() *zap.SugaredLogger
- func (z *ZapLogger) Debug(args ...interface{})
- func (z *ZapLogger) Debugf(template string, args ...interface{})
- func (z *ZapLogger) Debugw(msg string, keysAndValues ...interface{})
- func (z *ZapLogger) Error(args ...interface{})
- func (z *ZapLogger) Errorf(template string, args ...interface{})
- func (z *ZapLogger) Errorw(msg string, keysAndValues ...interface{})
- func (z *ZapLogger) Info(args ...interface{})
- func (z *ZapLogger) Infof(template string, args ...interface{})
- func (z *ZapLogger) Infow(msg string, keysAndValues ...interface{})
- func (z *ZapLogger) Named(name string) Logger
- func (z *ZapLogger) SetLevel(levelStr string)
- func (z *ZapLogger) Sync() error
- func (z *ZapLogger) Warn(args ...interface{})
- func (z *ZapLogger) Warnf(template string, args ...interface{})
- func (z *ZapLogger) Warnw(msg string, keysAndValues ...interface{})
- func (z *ZapLogger) With(args ...interface{}) Logger
- func (z *ZapLogger) WithTracingParams(ctx context.Context) Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LeafLogger ¶
type LeafLogger interface { Debug(args ...interface{}) Debugf(template string, args ...interface{}) Debugw(msg string, keysAndValues ...interface{}) Error(args ...interface{}) Errorf(template string, args ...interface{}) Errorw(msg string, keysAndValues ...interface{}) Info(args ...interface{}) Infof(template string, args ...interface{}) Infow(msg string, keysAndValues ...interface{}) SetLevel(level string) Sync() error Warn(args ...interface{}) Warnf(template string, args ...interface{}) Warnw(msg string, keysAndValues ...interface{}) }
Same as standard Logger interface except the Named and With functions are removed to prohibit creation of a child Logger from this Logger. This is useful if a function consumes a logger and produces a new logger that should not be used as a parent. In practice, this is used by our APM code so that a logger created with a span_id and trace_id is not then used as a parent of a child that will then put a second set of span_id and trace_id tags. The logger implementation does not overwrite fields of a parent logger even if they are the same.
type Logger ¶
type Logger interface { Debug(args ...interface{}) Debugf(template string, args ...interface{}) Debugw(msg string, keysAndValues ...interface{}) Error(args ...interface{}) Errorf(template string, args ...interface{}) Errorw(msg string, keysAndValues ...interface{}) Info(args ...interface{}) Infof(template string, args ...interface{}) Infow(msg string, keysAndValues ...interface{}) Named(name string) Logger SetLevel(level string) Sync() error Warn(args ...interface{}) Warnf(template string, args ...interface{}) Warnw(msg string, keysAndValues ...interface{}) With(args ...interface{}) Logger WithTracingParams(ctx context.Context) Logger //params map[string]interface{}, AsSugaredLogger() *zap.SugaredLogger }
Standard Logger interface
type NoopLogger ¶
type NoopLogger struct{}
func (*NoopLogger) AsSugaredLogger ¶
func (n *NoopLogger) AsSugaredLogger() *zap.SugaredLogger
func (*NoopLogger) Debug ¶
func (n *NoopLogger) Debug(args ...interface{})
func (*NoopLogger) Debugf ¶
func (n *NoopLogger) Debugf(template string, args ...interface{})
func (*NoopLogger) Debugw ¶
func (n *NoopLogger) Debugw(msg string, keysAndValues ...interface{})
func (*NoopLogger) Error ¶
func (n *NoopLogger) Error(args ...interface{})
func (*NoopLogger) Errorf ¶
func (n *NoopLogger) Errorf(template string, args ...interface{})
func (*NoopLogger) Errorw ¶
func (n *NoopLogger) Errorw(msg string, keysAndValues ...interface{})
func (*NoopLogger) Info ¶
func (n *NoopLogger) Info(args ...interface{})
func (*NoopLogger) Infof ¶
func (n *NoopLogger) Infof(template string, args ...interface{})
func (*NoopLogger) Infow ¶
func (n *NoopLogger) Infow(msg string, keysAndValues ...interface{})
func (*NoopLogger) Named ¶
func (n *NoopLogger) Named(name string) Logger
func (*NoopLogger) SetLevel ¶
func (n *NoopLogger) SetLevel(levelStr string)
func (*NoopLogger) Sync ¶
func (n *NoopLogger) Sync() error
func (*NoopLogger) Warn ¶
func (n *NoopLogger) Warn(args ...interface{})
func (*NoopLogger) Warnf ¶
func (n *NoopLogger) Warnf(template string, args ...interface{})
func (*NoopLogger) Warnw ¶
func (n *NoopLogger) Warnw(msg string, keysAndValues ...interface{})
func (*NoopLogger) With ¶
func (n *NoopLogger) With(args ...interface{}) Logger
func (*NoopLogger) WithTracingParams ¶
func (n *NoopLogger) WithTracingParams(ctx context.Context) Logger
type TracingProperties ¶
type ZapLogger ¶
type ZapLogger struct { Log *zap.SugaredLogger Config *zap.Config }
func NewZapLogger ¶
func (*ZapLogger) AsSugaredLogger ¶
func (z *ZapLogger) AsSugaredLogger() *zap.SugaredLogger
Click to show internal directories.
Click to hide internal directories.