Skip to main content

Module logging

Module logging 

Source
Expand description

API logging utilities Handles API query, error, and success logging with analytics

Structs§

ApiLogEntry
API log entry
ApiLogger
Global API logger
ApiUsage
Usage statistics from API response
CacheCreation
ServerToolUse

Enums§

ApiLogLevel
Log level for API logging
GlobalCacheStrategy
Global cache strategy type
KnownGateway
Known gateway types

Constants§

EMPTY_USAGE
Empty usage struct - zero-initialized usage object Extracted from emptyUsage.ts so that bridge/replBridge can import it without transitively pulling in api/errors.ts → utils/messages.ts → BashTool.tsx

Functions§

detect_gateway
Detect gateway from response headers or base URL
get_anthropic_env_metadata
Get Anthropic environment metadata from environment variables
get_api_provider_for_statsig
Get API provider for statsig
get_build_age_minutes
Get build age in minutes if BUILD_TIME is set
is_non_interactive_session
Check if running in non-interactive session
log_api_error
Log API error event
log_api_query
Log API query event
log_api_success
Log API success event