logsvc

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MPL-2.0-no-copyleft-exception Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DispatchTable

type DispatchTable map[string]func(wf Dispatcher, msg *log.LogMessage)

DispatchTable is a level -> execution function map

type Dispatcher

type Dispatcher interface {
	Debug(...interface{})
	Error(...interface{})
	Info(...interface{})
}

Dispatcher dispatches logs based on loglevel.

type LogJournal

type LogJournal struct {
	Journal map[string][]*log.LogMessage
	// contains filtered or unexported fields
}

LogJournal is a journal of log entries intended to facilitate mocking the logsvc.

func MakeLogServer

func MakeLogServer() (*handler.H, chan struct{}, *LogJournal, error)

MakeLogServer makes a logsvc.

func (*LogJournal) Append

func (lj *LogJournal) Append(level string, msg *log.LogMessage)

Append appends a message.

func (*LogJournal) Reset

func (lj *LogJournal) Reset()

Reset resets the log journal, erasing all recorded messages.

func (*LogJournal) Tail

func (lj *LogJournal) Tail()

Tail echoes all journal entries to stdout

type LogServer

type LogServer struct {
	DispatchTable DispatchTable
}

LogServer is the handle into the logging grpc service

func New

func New(table DispatchTable) *LogServer

New creates a new LogServer.

func (*LogServer) Put

func (ls *LogServer) Put(ctx context.Context, lm *log.LogMessage) (*empty.Empty, error)

Put submits a log message to the service, which in our current case, echoes it to stdout by way of sirupsen/logrus.

Jump to

Keyboard shortcuts

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