logging

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package logging provides a portable logging API with cross-cutting concerns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logging

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

Logging is the portable logging type wrapping a driver with cross-cutting concerns.

func NewLogging

func NewLogging(d driver.Logging, opts ...Option) *Logging

NewLogging creates a new portable Logging wrapping the given driver.

func (*Logging) CreateLogGroup

func (l *Logging) CreateLogGroup(ctx context.Context, config driver.LogGroupConfig) (*driver.LogGroupInfo, error)

CreateLogGroup creates a new log group.

func (*Logging) CreateLogStream

func (l *Logging) CreateLogStream(ctx context.Context, logGroup, streamName string) (*driver.LogStreamInfo, error)

CreateLogStream creates a new log stream in a log group.

func (*Logging) DeleteLogGroup

func (l *Logging) DeleteLogGroup(ctx context.Context, name string) error

DeleteLogGroup deletes a log group.

func (*Logging) DeleteLogStream

func (l *Logging) DeleteLogStream(ctx context.Context, logGroup, streamName string) error

DeleteLogStream deletes a log stream from a log group.

func (*Logging) GetLogEvents

func (l *Logging) GetLogEvents(ctx context.Context, input *driver.LogQueryInput) ([]driver.LogEvent, error)

GetLogEvents retrieves log events matching the query.

func (*Logging) GetLogGroup

func (l *Logging) GetLogGroup(ctx context.Context, name string) (*driver.LogGroupInfo, error)

GetLogGroup retrieves log group info.

func (*Logging) ListLogGroups

func (l *Logging) ListLogGroups(ctx context.Context) ([]driver.LogGroupInfo, error)

ListLogGroups lists all log groups.

func (*Logging) ListLogStreams

func (l *Logging) ListLogStreams(ctx context.Context, logGroup string) ([]driver.LogStreamInfo, error)

ListLogStreams lists all log streams in a log group.

func (*Logging) PutLogEvents

func (l *Logging) PutLogEvents(ctx context.Context, logGroup, streamName string, events []driver.LogEvent) error

PutLogEvents writes log events to a stream.

type Option

type Option func(*Logging)

Option configures a portable Logging.

func WithErrorInjection

func WithErrorInjection(i *inject.Injector) Option

WithErrorInjection sets the error injector.

func WithLatency

func WithLatency(d time.Duration) Option

WithLatency sets simulated latency.

func WithMetrics

func WithMetrics(m *metrics.Collector) Option

WithMetrics sets the metrics collector.

func WithRateLimiter

func WithRateLimiter(rl *ratelimit.Limiter) Option

WithRateLimiter sets the rate limiter.

func WithRecorder

func WithRecorder(r *recorder.Recorder) Option

WithRecorder sets the recorder.

Directories

Path Synopsis
Package driver defines the interface for logging service implementations.
Package driver defines the interface for logging service implementations.

Jump to

Keyboard shortcuts

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