aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
2.96k stars 556 forks source link

Pass client logger to request handlers #6130

Open trivikr opened 1 month ago

trivikr commented 1 month ago

Describe the feature

We currently emit Node.js http socket exhaustion warning in console.warn in https://github.com/smithy-lang/smithy-typescript/blob/main/packages/node-http-handler/src/node-http-handler.ts#L81-L89

Ideally, these should be emitted in the logger.warn provided by user while creating the client.

Use Case

The warnings emitted can pollute some customer output, if they're writing a CLI or a high level library.

Examples:

Proposed Solution

Pass client logger to request handlers, and use that for emitting warning/debug messages. The console.warn can always be used as a backup, if required.

Other Information

No response

Acknowledgements

SDK version used

All

Environment details (OS name and version, etc.)

All