Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUndefined tells the caller that the logger they tried to log to is not defined ErrUndefined = errors.New("Logger not defined") )
Functions ¶
This section is empty.
Types ¶
type DummyNotifierHarness ¶
type DummyNotifierHarness struct { }
DummyNotifierHarness is a struct that implements the uploader.NotifierHarness and uploader.NotifierHarness with nop implementations.
It exists because the code that uses the Harnesses doesn't accept nil for cases where we do not want to notify at all.
func (*DummyNotifierHarness) SendError ¶
func (d *DummyNotifierHarness) SendError(error)
SendError - nop implementation
func (*DummyNotifierHarness) SendMessage ¶
func (d *DummyNotifierHarness) SendMessage(r *uploader.UploadReceipt) error
SendMessage - nop implementation
type EventToStringFunc ¶
An EventToStringFunc takes a spade event and converts it to a string for logging into a line oriented file on s3
type KinesisLoggerConfig ¶
type KinesisLoggerConfig struct { // StreamName is the name of the Kinesis stream we are producing events into StreamName string // BatchLength is the max amount of globs per batch sent to Kinesis BatchLength int // BatchSize is the max size in bytes per batch sent to Kinesis BatchSize int // BatchAge is the max age of the oldest glob in the batch BatchAge string // GlobLength is the max amount of events per glob GlobLength int // GlobSize is the max size in bytes per glob GlobSize int // GlobAge is the max age of the oldest record in the glob GlobAge string // BufferLength is the length of the buffer in front of the kinesis production code. If the buffer fills // up events will be written to the fallback logger BufferLength uint // MaxAttemptsPerRecord is the maximum amounts an event will be resent to Kinesis on failure // before it is written to the fallback logger MaxAttemptsPerRecord int // RetryDelay is how long to delay between retries on failed attempts to write to kinesis RetryDelay string }
KinesisLoggerConfig is used to configure a new SpadeEdgeLogger that writes to an AWS Kinesis stream. There are no default values and all fields are required.
func (*KinesisLoggerConfig) Validate ¶
func (c *KinesisLoggerConfig) Validate() error
Validate verifies that a KinesisLoggerConfig is valid, and updates any internal members
type S3LoggerConfig ¶
S3LoggerConfig configures a new SpadeEdgeLogger that writes lines of text to AWS S3
type SpadeEdgeLogger ¶
A SpadeEdgeLogger stores events that are received at the spade edge
func NewKinesisLogger ¶
func NewKinesisLogger(client *kinesis.Kinesis, config KinesisLoggerConfig, fallback SpadeEdgeLogger, statter statsd.Statter) (SpadeEdgeLogger, error)
NewKinesisLogger creates a new SpadeEdgeLogger that writes to an AWS Kinesis stream and starts the main loop
func NewS3Logger ¶
func NewS3Logger( config S3LoggerConfig, loggingDir string, printFunc EventToStringFunc, sqs sqsiface.SQSAPI, S3Uploader s3manageriface.UploaderAPI, ) (SpadeEdgeLogger, error)
NewS3Logger returns a new SpadeEdgeLogger that events to S3 after transforming the events into lines of text using the printFunc
type UndefinedLogger ¶
type UndefinedLogger struct { }
UndefinedLogger is a struct that implements the SpadeEdgeLogger interface with nop implementations