MCPcopy Create free account
hub / github.com/freecodexyz/free-code / createStderrLogger

Function createStderrLogger

src/services/api/client.ts:81–94  ·  view source on GitHub ↗

* Environment variables for different client types: * * Direct API: * - ANTHROPIC_API_KEY: Required for direct API access * * AWS Bedrock: * - AWS credentials configured via aws-sdk defaults * - AWS_REGION or AWS_DEFAULT_REGION: Sets the AWS region for all models (default: us-east-1) * - ANT

()

Source from the content-addressed store, hash-verified

79 */
80
81function createStderrLogger(): ClientOptions['logger'] {
82 return {
83 error: (msg, ...args) =>
84 // biome-ignore lint/suspicious/noConsole:: intentional console output -- SDK logger must use console
85 console.error('[Anthropic SDK ERROR]', msg, ...args),
86 // biome-ignore lint/suspicious/noConsole:: intentional console output -- SDK logger must use console
87 warn: (msg, ...args) => console.error('[Anthropic SDK WARN]', msg, ...args),
88 // biome-ignore lint/suspicious/noConsole:: intentional console output -- SDK logger must use console
89 info: (msg, ...args) => console.error('[Anthropic SDK INFO]', msg, ...args),
90 debug: (msg, ...args) =>
91 // biome-ignore lint/suspicious/noConsole:: intentional console output -- SDK logger must use console
92 console.error('[Anthropic SDK DEBUG]', msg, ...args),
93 }
94}
95
96export async function getAnthropicClient({
97 apiKey,

Callers 1

getAnthropicClientFunction · 0.85

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected