Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: log clientName and commandName #1637

Merged
merged 1 commit into from
Oct 29, 2020

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Oct 29, 2020

Issue #, if available:
Codegen for: smithy-lang/smithy-typescript#230
Fixes: #1489

Description of changes:
feat: log clientName and commandName.

Code
const { DynamoDB } = require("/home/trivikr/workspace/aws-sdk-js-v3/clients/client-dynamodb");

(async () => {
  const region = "us-west-2";
  const logger = { info: console.log };

  const client = new DynamoDB({ region, logger });
  await client.listTables({ Limit: 1 });
})();
Output
{ clientName: 'DynamoDBClient', commandName: 'ListTablesCommand' }
{ input: { Limit: 1 } }
{
  output: {
    LastEvaluatedTableName: 'CUSTOMER_LIST',
    TableNames: [ 'CUSTOMER_LIST' ]
  }
}
{
  '$metadata': {
    httpStatusCode: 200,
    httpHeaders: {
      server: 'Server',
      date: 'Thu, 29 Oct 2020 00:07:40 GMT',
      'content-type': 'application/x-amz-json-1.0',
      'content-length': '73',
      connection: 'keep-alive',
      'x-amzn-requestid': 'NL79U75I1LNUOVK5IBPD5JES0BVV4KQNSO5AEMVJF66Q9ASUAAJG',
      'x-amz-crc32': '773170490'
    },
    requestId: 'NL79U75I1LNUOVK5IBPD5JES0BVV4KQNSO5AEMVJF66Q9ASUAAJG',
    attempts: 1,
    totalRetryDelay: 0
  }
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-io
Copy link

Codecov Report

Merging #1637 into master will decrease coverage by 0.11%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1637      +/-   ##
==========================================
- Coverage   79.73%   79.62%   -0.12%     
==========================================
  Files         324      325       +1     
  Lines       12056    12503     +447     
  Branches     2547     2657     +110     
==========================================
+ Hits         9613     9955     +342     
- Misses       2443     2548     +105     
Impacted Files Coverage Δ
...tocol_tests/aws-restxml/commands/XmlMapsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...ocol_tests/aws-restxml/commands/XmlBlobsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...ocol_tests/aws-restxml/commands/XmlEnumsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...ocol_tests/aws-restxml/commands/XmlListsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...col_tests/aws-restjson/commands/JsonMapsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...ol_tests/aws-restjson/commands/JsonBlobsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...ol_tests/aws-restjson/commands/JsonEnumsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...ol_tests/aws-restjson/commands/JsonListsCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...tests/aws-restxml/commands/XmlAttributesCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
...tests/aws-restxml/commands/XmlNamespacesCommand.ts 95.65% <0.00%> (-4.35%) ⬇️
... and 95 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e72d03b...1e39366. Read the comment docs.

@AllanZhengYP
Copy link
Contributor

I'm a little worried about clientName being populated in command instead of client. But it's a very minor issue.

@trivikr trivikr merged commit 79f25ca into aws:master Oct 29, 2020
@trivikr trivikr deleted the log-clientName-commandName branch October 29, 2020 21:28
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add clientName and commandName to logger metadata
3 participants