Documentation ¶
Index ¶
- type Encoder
- type ITracer
- type ITracerFactory
- type ITracerProvider
- type NoOpTracer
- func (tracer *NoOpTracer) Enabled() bool
- func (tracer *NoOpTracer) Error(err error, msg string, keysAndValues ...interface{})
- func (tracer *NoOpTracer) Info(msg string, keysAndValues ...interface{})
- func (tracer *NoOpTracer) V(level int) logr.Logger
- func (tracer *NoOpTracer) WithName(name string) logr.Logger
- func (tracer *NoOpTracer) WithValues(keysAndValues ...interface{}) logr.Logger
- type NoOpTracerProvider
- type TracerConfiguration
- type TracerProvider
- type ZaprTracerFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder int
Encoder is enum that indicate how the tracer should encode the msgs.
type ITracerFactory ¶
type ITracerFactory interface { // CreateTracer creates ITracer interface. CreateTracer() (tracer ITracer) }
ITracerFactory interface of tracer factory
type ITracerProvider ¶
type ITracerProvider interface { // GetTracer Gets a tracer with specific context. the context is according to specific method //(when you create the ITraceProvider you choose the struct context) GetTracer(context string) (tracer ITracer) }
ITracerProvider provides tracer. the difference between ITracerProvider and ITracerFactory is that ITracerFactory creates ITracer , and the ITracerProvider doesn't create tracer,it provides exists tracer in specific context.
type NoOpTracer ¶
type NoOpTracer struct{}
NoOpTracer is implementation that does nothing of ITracer NoOp is used for testing/debugging.
func (*NoOpTracer) Enabled ¶
func (tracer *NoOpTracer) Enabled() bool
func (*NoOpTracer) Error ¶
func (tracer *NoOpTracer) Error(err error, msg string, keysAndValues ...interface{})
func (*NoOpTracer) Info ¶
func (tracer *NoOpTracer) Info(msg string, keysAndValues ...interface{})
func (*NoOpTracer) WithValues ¶
func (tracer *NoOpTracer) WithValues(keysAndValues ...interface{}) logr.Logger
type NoOpTracerProvider ¶
type NoOpTracerProvider struct { }
NoOpTracerProvider is implementation that does nothing of ITracerProvider NoOp is used for testing/debugging.
func NewNoOpTracerProvider ¶
func NewNoOpTracerProvider() *NoOpTracerProvider
NewNoOpTracerProvider Ctor for NoOpTracerProvider
func (*NoOpTracerProvider) GetTracer ¶
func (provider *NoOpTracerProvider) GetTracer(context string) (tracer ITracer)
GetTracer Gets a tracer with specific context. the context is according to specific method (when you create the ITraceProvider you choose the struct context)
type TracerConfiguration ¶
type TracerConfiguration struct { // TracerLevel is the level of the logger. TracerLevel zapcore.Level // DefaultTrace DefaultContext string // EncoderLogs EncoderLogs Encoder }
TracerConfiguration is the configuration of the tracer.
type TracerProvider ¶
type TracerProvider struct {
// contains filtered or unexported fields
}
TracerProvider implements ITracerProvider interface. it wraps exists ITracer and add to ITracer context in the struct level. e.g. Server contains TracerProvider struct with the "Server" context.
func NewTracerProvider ¶
func NewTracerProvider(tracer ITracer, context string) (provider *TracerProvider)
NewTracerProvider gets an exists ITracer and context, and it wraps the tracer with the new context
func (*TracerProvider) GetTracer ¶
func (provider *TracerProvider) GetTracer(context string) (tracer ITracer)
GetTracer returns tracer with new context (the context now is in the method level - e.g. Server.Run is the context)
type ZaprTracerFactory ¶
type ZaprTracerFactory struct {
// contains filtered or unexported fields
}
ZaprTracerFactory implementation of ITracerFactory.
func NewZaprTracerFactory ¶
func NewZaprTracerFactory(configuration *TracerConfiguration) *ZaprTracerFactory
NewZaprTracerFactory creates new TracerFactory instance.
func (*ZaprTracerFactory) CreateTracer ¶
func (factory *ZaprTracerFactory) CreateTracer() (tracer ITracer)
CreateTracer Creates tracer