logging

package
v0.2.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFields

func AddFields(base []any, keyValues ...any) []any

AddFields is a helper to build field arrays safely

func NewCompositionStatusLogger

func NewCompositionStatusLogger(mgr ctrl.Manager, freq time.Duration) error

NewCompositionStatusLogger creates a telemetry controller for logging Composition status changes

func NewLoggerWithBuild

func NewLoggerWithBuild(zl *zap.Logger, buildVersion string) logr.Logger

NewLoggerWithBuild creates a logger with serviceBuild field if buildVersion is provided

func NewSynthesizerTelemetryLogger

func NewSynthesizerTelemetryLogger(mgr ctrl.Manager, freq time.Duration) error

NewSynthesizerTelemetry creates a telemetry controller for Synthesizer CRs

func NewTelemetryController

func NewTelemetryController[T client.Object](config TelemetryConfig[T], obj T) error

NewTelemetryController creates a generic telemetry controller

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger provides common telemetry logging functionality

func NewLogger

func NewLogger() *Logger

NewLogger creates a new telemetry logger with default log function

func (*Logger) Log

func (l *Logger) Log(ctx context.Context, msg string, field ...any)

func (*Logger) WithLogFn

func (l *Logger) WithLogFn(fn func(ctx context.Context, msg string, args ...any)) *Logger

type TelemetryConfig

type TelemetryConfig[T client.Object] struct {
	Manager         ctrl.Manager
	Frequency       time.Duration
	PredicateFn     func() predicate.Predicate
	ExtractFieldsFn func(ctx context.Context, obj T) []any
	EventTypeFn     func(obj T) string
	MessageFn       func() string
	ControllerName  string
	Logger          *Logger
}

TelemetryConfig configures a telemetry controller

type TelemetryController

type TelemetryController[T client.Object] struct {
	// contains filtered or unexported fields
}

Telemetry controller is a generic telemetry controller that can be used for any CR

func (*TelemetryController[T]) Reconcile

func (c *TelemetryController[T]) Reconcile(ctx context.Context, req reconcile.Request) (ctrl.Result, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL