log_sender

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2016 License: Apache-2.0 Imports: 11 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventEmitter

type EventEmitter interface {
	Emit(events.Event) error
	EmitEnvelope(*events.Envelope) error
	Origin() string
}

type LogChainer

type LogChainer interface {
	SetTimestamp(t int64) LogChainer
	SetTag(key, value string) LogChainer
	SetAppId(id string) LogChainer
	SetSourceType(s string) LogChainer
	SetSourceInstance(s string) LogChainer
	Send() error
}

type LogSender

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

A LogSender emits log events.

func NewLogSender

func NewLogSender(eventEmitter EventEmitter, logger *gosteno.Logger) *LogSender

NewLogSender instantiates a LogSender with the given EventEmitter.

func (*LogSender) LogMessage

func (l *LogSender) LogMessage(message []byte, msgType events.LogMessage_MessageType) LogChainer

LogMessage creates a log message that can be manipulated via cascading calls and then sent.

func (*LogSender) ScanErrorLogStream

func (l *LogSender) ScanErrorLogStream(appID, sourceType, sourceInstance string, reader io.Reader)

ScanErrorLogStream sends a log error message with the given meta-data for each line from reader. Restarts on read errors and continues until EOF.

func (*LogSender) ScanLogStream

func (l *LogSender) ScanLogStream(appID, sourceType, sourceInstance string, reader io.Reader)

ScanLogStream sends a log message with the given meta-data for each line from reader. Restarts on read errors and continues until EOF.

func (*LogSender) SendAppErrorLog

func (l *LogSender) SendAppErrorLog(appID, message, sourceType, sourceInstance string) error

SendAppErrorLog sends a log error message with the given appid and log message with a message type of std err. Returns an error if one occurs while sending the event.

func (*LogSender) SendAppLog

func (l *LogSender) SendAppLog(appID, message, sourceType, sourceInstance string) error

SendAppLog sends a log message with the given appid and log message with a message type of std out. Returns an error if one occurs while sending the event.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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