Documentation
¶
Overview ¶
Package logger provides append-only JSONL usage logging to daily files under ~/.dosrouter/logs/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogUsage ¶
func LogUsage(entry UsageEntry)
LogUsage appends a JSON line to the daily log file. It silently swallows errors so it never breaks the request flow.
Types ¶
type UsageEntry ¶
type UsageEntry struct {
Timestamp string `json:"timestamp"`
Model string `json:"model"`
Tier string `json:"tier"`
Cost float64 `json:"cost"`
BaselineCost float64 `json:"baselineCost"`
Savings float64 `json:"savings"`
LatencyMs int64 `json:"latencyMs"`
Status string `json:"status,omitempty"`
InputTokens int `json:"inputTokens,omitempty"`
OutputTokens int `json:"outputTokens,omitempty"`
PartnerID string `json:"partnerId,omitempty"`
Service string `json:"service,omitempty"`
}
UsageEntry represents a single usage log record.
Click to show internal directories.
Click to hide internal directories.