log_sender

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 10 Imported by: 23 modules, 36 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

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) *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