Documentation
¶
Index ¶
- Variables
- type FilterJSON
- type FilterLevel
- type FilterResources
- type FilterSince
- type FilterSource
- type FilterTail
- type FollowFlag
- type IncrementalPrinter
- type JSONLogLine
- type JSONPrinter
- type LogFilter
- func (f LogFilter) Apply(lines []logstore.LogLine) []logstore.LogLine
- func (f LogFilter) ApplyWithOptions(lines []logstore.LogLine, applyTail bool) []logstore.LogLine
- func (f LogFilter) ApplyWithoutTail(lines []logstore.LogLine) []logstore.LogLine
- func (f LogFilter) JSONOutput() bool
- func (f LogFilter) Matches(line logstore.LogLine) bool
- func (f LogFilter) MatchesAll(line logstore.LogLine) bool
- func (f LogFilter) SuppressPrefix() bool
- func (f LogFilter) Tail() int
- type LogPrinter
- type LogStreamer
- type Stdout
- type TerminalStream
- type ViewHandler
- type WebsocketConn
- type WebsocketReader
Constants ¶
This section is empty.
Variables ¶
var WireSet = wire.NewSet( NewLogStreamer, ProvideLogPrinter, NewLogFilter, ProvideStdout, NewIncrementalPrinter, NewTerminalStream, )
Functions ¶
This section is empty.
Types ¶
type FilterJSON ¶ added in v0.36.1
type FilterJSON bool
FilterJSON indicates whether to output logs in JSON format.
type FilterLevel ¶ added in v0.36.1
type FilterResources ¶ added in v0.36.1
type FilterResources []model.ManifestName
func (FilterResources) Matches ¶ added in v0.36.1
func (r FilterResources) Matches(name model.ManifestName) bool
type FilterSince ¶ added in v0.36.1
FilterSince represents an absolute timestamp for time-based log filtering. Zero value (time.Time{}) means no time filter. The CLI layer converts duration flags (e.g., "5m") to timestamps.
type FilterSource ¶ added in v0.36.1
type FilterSource string
const ( FilterSourceAll FilterSource = "all" FilterSourceBuild FilterSource = "build" FilterSourceRuntime FilterSource = "runtime" )
func (FilterSource) String ¶ added in v0.36.1
func (s FilterSource) String() string
type FilterTail ¶ added in v0.36.1
type FilterTail int
FilterTail represents the number of lines to show from the end. -1 means no limit, 0+ means limit to that many lines.
type FollowFlag ¶ added in v0.36.1
type FollowFlag bool
type IncrementalPrinter ¶ added in v0.36.1
type IncrementalPrinter struct {
// contains filtered or unexported fields
}
func NewIncrementalPrinter ¶ added in v0.36.1
func NewIncrementalPrinter(stdout Stdout) *IncrementalPrinter
func (*IncrementalPrinter) Print ¶ added in v0.36.1
func (p *IncrementalPrinter) Print(lines []logstore.LogLine)
func (*IncrementalPrinter) PrintNewline ¶ added in v0.36.1
func (p *IncrementalPrinter) PrintNewline()
type JSONLogLine ¶ added in v0.36.1
type JSONLogLine struct {
Time *string `json:"time,omitempty"`
Resource *string `json:"resource,omitempty"`
Level *string `json:"level,omitempty"`
Message *string `json:"message,omitempty"`
SpanID *string `json:"spanID,omitempty"`
ProgressID *string `json:"progressID,omitempty"`
BuildEvent *string `json:"buildEvent,omitempty"`
Source *string `json:"source,omitempty"`
}
JSONLogLine represents a log line in JSON format. Fields use pointer types so we can distinguish between "not included" (nil) and "included but empty" (pointer to empty string).
type JSONPrinter ¶ added in v0.36.1
type JSONPrinter struct {
// contains filtered or unexported fields
}
JSONPrinter outputs log lines as JSON Lines (one JSON object per line).
func NewJSONPrinter ¶ added in v0.36.1
func NewJSONPrinter(stdout Stdout) *JSONPrinter
NewJSONPrinter creates a new JSON printer.
func (*JSONPrinter) Print ¶ added in v0.36.1
func (p *JSONPrinter) Print(lines []logstore.LogLine)
Print outputs log lines as JSON Lines.
func (*JSONPrinter) PrintNewline ¶ added in v0.36.1
func (p *JSONPrinter) PrintNewline()
PrintNewline writes a newline to output.
type LogFilter ¶ added in v0.36.1
type LogFilter struct {
// contains filtered or unexported fields
}
func NewLogFilter ¶ added in v0.36.1
func NewLogFilter( source FilterSource, resources FilterResources, level FilterLevel, since FilterSince, tail FilterTail, jsonOutput FilterJSON, ) LogFilter
func (LogFilter) ApplyWithOptions ¶ added in v0.36.1
ApplyWithOptions applies the filter with control over tail application.
func (LogFilter) ApplyWithoutTail ¶ added in v0.36.1
ApplyWithoutTail applies the filter but skips the tail limit. Use this for streaming batches after the initial history.
func (LogFilter) JSONOutput ¶ added in v0.36.1
JSONOutput returns whether JSON output is enabled.
func (LogFilter) Matches ¶ added in v0.36.1
Matches Checks if this line matches the current filter. The implementation is identical to matchesFilter in web/src/OverviewLogPane.tsx. except for term filtering as tools like grep can be used from the CLI.
func (LogFilter) MatchesAll ¶ added in v0.36.1
MatchesAll checks if this line matches all filters including time-based filtering.
func (LogFilter) SuppressPrefix ¶ added in v0.36.1
don't need the resource name prefix if: - printing logs for only one resource - printing logs to json
type LogPrinter ¶ added in v0.36.1
LogPrinter is the interface for printing log lines.
func ProvideLogPrinter ¶ added in v0.36.1
func ProvideLogPrinter(filter LogFilter, stdout Stdout) LogPrinter
type LogStreamer ¶ added in v0.36.1
type LogStreamer struct {
// contains filtered or unexported fields
}
func NewLogStreamer ¶ added in v0.36.1
func NewLogStreamer(follow FollowFlag, url model.WebURL, filter LogFilter, printer LogPrinter) *LogStreamer
type Stdout ¶ added in v0.36.1
func ProvideStdout ¶ added in v0.36.1
func ProvideStdout() Stdout
type TerminalStream ¶ added in v0.36.1
type TerminalStream struct {
ProcessedLogs logstore.Checkpoint
// contains filtered or unexported fields
}
func NewTerminalStream ¶ added in v0.36.1
func NewTerminalStream(printer *IncrementalPrinter, filter LogFilter, store store.RStore) *TerminalStream
func (*TerminalStream) OnChange ¶ added in v0.36.1
func (h *TerminalStream) OnChange(ctx context.Context, st store.RStore, _ store.ChangeSummary) error
func (*TerminalStream) TearDown ¶ added in v0.36.1
func (h *TerminalStream) TearDown(ctx context.Context)
TODO(nick): We should change this API so that TearDown gets the RStore one last time.
type ViewHandler ¶ added in v0.36.1
type ViewHandler interface {
Handle(v *proto_webview.View) error
}
type WebsocketConn ¶ added in v0.36.1
type WebsocketReader ¶ added in v0.36.1
type WebsocketReader struct {
// contains filtered or unexported fields
}