Documentation ¶
Index ¶
- type PreHook
- func (hook *PreHook) ProcessInput(traceIDs belt.TraceIDs, _ loggertypes.Level, _ ...any) loggertypes.PreHookResult
- func (hook *PreHook) ProcessInputFields(traceIDs belt.TraceIDs, _ loggertypes.Level, _ string, _ field.AbstractFields) loggertypes.PreHookResult
- func (hook *PreHook) ProcessInputf(traceIDs belt.TraceIDs, _ loggertypes.Level, _ string, _ ...any) loggertypes.PreHookResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PreHook ¶
PreHook is a types.PreHook implementation which samples the log entries. This is supposed to be used for performance reasons in high performance applications.
Setup example:
import ( "github.com/facebookincubator/go-belt/pkg/sampler" samplerhook "github.com/facebookincubator/go-belt/tool/logger/hooks/sampler" "github.com/facebookincubator/go-belt/tool/logger/implementation/zap" ) func main() { ... ctx = logger.CtxWithLogger(ctx, zap.Default().WithPreHooks( samplerhook.NewPreHook(sampler.RandomSampler(0.1)), )) ... }
func NewPreHook ¶
NewPreHook returns a new instance of PreHook
func (*PreHook) ProcessInput ¶
func (hook *PreHook) ProcessInput(traceIDs belt.TraceIDs, _ loggertypes.Level, _ ...any) loggertypes.PreHookResult
ProcessInput implements types.PreHook.
func (*PreHook) ProcessInputFields ¶
func (hook *PreHook) ProcessInputFields(traceIDs belt.TraceIDs, _ loggertypes.Level, _ string, _ field.AbstractFields) loggertypes.PreHookResult
ProcessInputFields implements types.PreHook.
func (*PreHook) ProcessInputf ¶
func (hook *PreHook) ProcessInputf(traceIDs belt.TraceIDs, _ loggertypes.Level, _ string, _ ...any) loggertypes.PreHookResult
ProcessInputf implements types.PreHook.
Click to show internal directories.
Click to hide internal directories.