log

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogEntry

type LogEntry struct {
	ID              string              `json:"id"`
	Timestamp       time.Time           `json:"timestamp"`
	Service         string              `json:"service"`
	Method          string              `json:"method"`
	ClientProtocol  string              `json:"clientProtocol"`
	Status          int                 `json:"status"`
	Duration        time.Duration       `json:"duration"`
	RequestHeaders  json.RawMessage     `json:"requestHeaders"`
	ResponseHeaders json.RawMessage     `json:"responseHeaders"`
	RequestBody     json.RawMessage     `json:"requestBody"`
	ResponseBody    json.RawMessage     `json:"responseBody"`
	RequestFrames   []json.RawMessage   `json:"requestFrames,omitempty"`
	ResponseFrames  []json.RawMessage   `json:"responseFrames,omitempty"`
	StubsUsed       []fauxrpc.StubEntry `json:"stubsUsed,omitempty"`
}

LogEntry represents a single log entry for a request.

type Logger

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

Logger manages the log entries and subscriptions.

func NewLogger

func NewLogger() *Logger

NewLogger creates a new Logger.

func (*Logger) Log

func (l *Logger) Log(entry *LogEntry)

Log adds a new entry and notifies subscribers.

func (*Logger) Subscribe

func (l *Logger) Subscribe() (chan *LogEntry, func())

Subscribe adds a new subscriber channel.

Jump to

Keyboard shortcuts

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