logging

package
v0.0.0-...-457f07e Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrUnexpectedFormat = errors.ConstError("unexpected format")

	HeaderFormat = "Fmt"
	HeaderLogFmt = "LogFmt"
	HeaderTerm   = "Term"
)
View Source
const (
	RecordTerm   = iota
	RecordLogFmt = 1
)

Variables

This section is empty.

Functions

func SetAgentsByNKey

func SetAgentsByNKey(ctx context.Context, byName AgentIndex) context.Context

func SetAgentsByName

func SetAgentsByName(ctx context.Context, byName AgentIndex) context.Context

func UnmarshalLogFmtRecord

func UnmarshalLogFmtRecord(ctx context.Context, msg *nats.Msg, record *LogFmtRecord) (err error)

func UnmarshalTerminalRecord

func UnmarshalTerminalRecord(ctx context.Context, msg *nats.Msg, record *TerminalRecord) (err error)

Types

type AgentIndex

type AgentIndex = map[string]*info.Response

func GetAgentsByNKey

func GetAgentsByNKey(ctx context.Context) AgentIndex

func GetAgentsByName

func GetAgentsByName(ctx context.Context) AgentIndex

type LogFmtRecord

type LogFmtRecord struct {
	Level log.Level
	Text  string
	Meta  map[string]string

	Timestamp time.Time
	// contains filtered or unexported fields
}

func (*LogFmtRecord) Msg

func (r *LogFmtRecord) Msg() *nats.Msg

func (*LogFmtRecord) Type

func (r *LogFmtRecord) Type() RecordType

func (*LogFmtRecord) Write

func (r *LogFmtRecord) Write(file *os.File) (n int, err error)

type Record

type Record interface {
	Type() RecordType
	Msg() *nats.Msg
	Write(file *os.File) (n int, err error)
}

type RecordReader

type RecordReader struct {
	Sub     *nats.Subscription
	Context context.Context
}

func (*RecordReader) Read

func (r *RecordReader) Read() (record Record, err error)

type RecordType

type RecordType int

type TerminalRecord

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

func (*TerminalRecord) Msg

func (t *TerminalRecord) Msg() *nats.Msg

func (*TerminalRecord) Type

func (t *TerminalRecord) Type() RecordType

func (*TerminalRecord) Write

func (t *TerminalRecord) Write(file *os.File) (n int, err error)

Jump to

Keyboard shortcuts

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