MCPcopy Index your code
hub / github.com/codeaashu/claude-code / createStderrLogger

Function createStderrLogger

src/services/api/client.ts:73–86  ·  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

71 */
72
73function createStderrLogger(): ClientOptions['logger'] {
74 return {
75 error: (msg, ...args) =>
76 // biome-ignore lint/suspicious/noConsole:: intentional console output -- SDK logger must use console
77 console.error('[Anthropic SDK ERROR]', msg, ...args),
78 // biome-ignore lint/suspicious/noConsole:: intentional console output -- SDK logger must use console
79 warn: (msg, ...args) => console.error('[Anthropic SDK WARN]', msg, ...args),
80 // biome-ignore lint/suspicious/noConsole:: intentional console output -- SDK logger must use console
81 info: (msg, ...args) => console.error('[Anthropic SDK INFO]', msg, ...args),
82 debug: (msg, ...args) =>
83 // biome-ignore lint/suspicious/noConsole:: intentional console output -- SDK logger must use console
84 console.error('[Anthropic SDK DEBUG]', msg, ...args),
85 }
86}
87
88export async function getAnthropicClient({
89 apiKey,

Callers 1

getAnthropicClientFunction · 0.85

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected