logview

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseLog

func ParseLog(manifestPath string) (string, error)

ParseLog parses a log file using the appropriate parser based on the agent type

func ParseLogFromPath

func ParseLogFromPath(logPath string) (string, error)

ParseLogFromPath parses a log file directly without using manifest

func RegisterParser

func RegisterParser(agent string, p Parser)

RegisterParser registers a parser for a specific agent

Types

type ClaudeLogEntry

type ClaudeLogEntry struct {
	Type      string                 `json:"type"`
	Subtype   string                 `json:"subtype,omitempty"`
	SessionID string                 `json:"session_id,omitempty"`
	Message   *ClaudeMessage         `json:"message,omitempty"`
	Tools     []string               `json:"tools,omitempty"`
	Model     string                 `json:"model,omitempty"`
	Extra     map[string]interface{} `json:"-"`
}

LogEntry represents a single log line in Claude format

type ClaudeMessage

type ClaudeMessage struct {
	ID      string        `json:"id"`
	Type    string        `json:"type"`
	Role    string        `json:"role"`
	Model   string        `json:"model,omitempty"`
	Content []interface{} `json:"content"`
}

ClaudeMessage represents a message within a log entry

type ClaudeParser

type ClaudeParser struct{}

ClaudeParser parses Claude Code agent logs

func (*ClaudeParser) Name

func (p *ClaudeParser) Name() string

Name returns the parser name

func (*ClaudeParser) Parse

func (p *ClaudeParser) Parse(logPath string) (string, error)

Parse reads the Claude log and produces a structured, readable representation

type FallbackParser

type FallbackParser struct{}

FallbackParser returns the raw log content for unknown agents

func (*FallbackParser) Name

func (p *FallbackParser) Name() string

Name returns the parser name

func (*FallbackParser) Parse

func (p *FallbackParser) Parse(logPath string) (string, error)

Parse returns the raw log content

type Parser

type Parser interface {
	// Parse reads the log and produces a structured, readable representation
	Parse(logPath string) (string, error)
	// Name returns the parser name
	Name() string
}

Parser defines the interface for parsing execution logs

func GetParser

func GetParser(agent string) Parser

GetParser retrieves a parser for the given agent, returns nil if not found

Jump to

Keyboard shortcuts

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