logexporter

package
v0.54.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	Level   string        `json:"level"`
	Time    time.Time     `json:"time"`
	Message string        `json:"message"`
	Fields  logrus.Fields `json:"fields"`
}

type LogExporter

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

LogExporter hooks into logrus and sends logs to Mothership.

func NewLogExporter

func NewLogExporter(logger *logrus.Logger, sender LogSender) *LogExporter

NewLogExporter returns new exporter that can be hooked into logrus to inject logs into Cast AI.

func (*LogExporter) Fire

func (e *LogExporter) Fire(entry *logrus.Entry) error

Fire called by logrus with log entry that LogExporter sends out.

func (*LogExporter) Levels

func (e *LogExporter) Levels() []logrus.Level

Levels lists levels that tell logrus to trigger log injection.

func (*LogExporter) Wait

func (e *LogExporter) Wait()

Wait lets all pending log sends to finish.

type LogSender

type LogSender interface {
	SendLog(ctx context.Context, e *LogEntry) error
}

Directories

Path Synopsis
Package mock_logexporter is a generated GoMock package.
Package mock_logexporter is a generated GoMock package.

Jump to

Keyboard shortcuts

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