logger

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Debugf(format string, args ...any)
	Infof(format string, args ...any)
	Warnf(format string, args ...any)
	Errorf(format string, args ...any)
}

Logger provides a standardized logging interface for the Iterable Go client. It defines methods for different log levels (Debug, Info, Warn, Error) to enable consistent logging throughout the client library. This interface allows users to plug in their preferred logging implementation (e.g., glog, logrus, zap, standard log) or use the provided Noop logger to disable logging entirely.

The logger is used throughout the client for: - API request/response debugging - Batch processing status and errors - Retry attempt tracking - Connection and transport issues

Usage Example:

// Using with a custom logger implementation
client := iterable_go.NewClient(apiKey, iterable_go.WithLogger(myLogger))

// Using with batch processing
batch := iterable_go.NewBatch(client, iterable_go.WithBatchLogger(myLogger))

// Disable logging entirely
client := iterable_go.NewClient(apiKey, iterable_go.WithLogger(&logger.Noop{}))

func NewStdOut

func NewStdOut() Logger

type Noop

type Noop struct {
}

func (Noop) Debugf

func (n Noop) Debugf(format string, args ...any)

func (Noop) Errorf

func (n Noop) Errorf(format string, args ...any)

func (Noop) Infof

func (n Noop) Infof(format string, args ...any)

func (Noop) Warnf

func (n Noop) Warnf(format string, args ...any)

Jump to

Keyboard shortcuts

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