log

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = &Collector{}

Functions

func FileSink

func FileSink(w io.Writer, filters ...EventType)

FileSink writes every event (JSON encoded) to w, filtering by event types if provided.

func Publish

func Publish(e Event)

Publish sends an event to all subscribers (non-blocking).

Types

type Collector

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

Collector collects events and fans them out to subscribers.

func (*Collector) Publish

func (c *Collector) Publish(e Event)

func (*Collector) Subscribe

func (c *Collector) Subscribe(buf int) <-chan Event

Subscribe returns a receive-only channel for events. buf is channel size.

type Event

type Event struct {
	Time      time.Time   `json:"ts"`
	EventType EventType   `json:"eventtype"`
	Payload   interface{} `json:"p"`
}

type EventType

type EventType string

EventType represents classification of an event.

const (
	LLMInput   EventType = "LLM_INPUT"
	LLMOutput  EventType = "LLM_OUTPUT"
	TaskInput  EventType = "TASK_INPUT"
	TaskOutput EventType = "TASK_OUTPUT"
	TaskWhen   EventType = "TASK_WHEN"
	PlanOutput EventType = "PLAN_OUTPUT"
)

Jump to

Keyboard shortcuts

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