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

Docs: extract Logger code snippets in separate files #1220

Closed
1 task done
dreamorosi opened this issue Jan 10, 2023 · 5 comments · Fixed by #1230
Closed
1 task done

Docs: extract Logger code snippets in separate files #1220

dreamorosi opened this issue Jan 10, 2023 · 5 comments · Fixed by #1230
Assignees
Labels
completed This item is complete and has been merged/shipped documentation Improvements or additions to documentation

Comments

@dreamorosi
Copy link
Contributor

dreamorosi commented Jan 10, 2023

What were you searching in the docs?

Currently the code snippets in the documentation under the Logger's section are hardcoded as part of the page's markdown.

This authoring experience, which doesn't provide linting, is error prone, which causes issues in the docs and in turns to users.

This issue is part of a larger effort being tracked at #729.

Is this related to an existing documentation section?

https://awslabs.github.io/aws-lambda-powertools-typescript/latest/core/logger/

How can we improve?

The code snippets should be extracted to their own separate files, placed under docs/snippets/logger.

So for instance, the first snippet that currently reads:

import { Logger } from '@aws-lambda-powertools/logger';

const logger = new Logger({ serviceName: 'serverlessAirline' });

export const handler = async (_event, _context): Promise<void> => {
    // ...
};

would be replaced with:

--8<-- "docs/snippets/logger/basicUsage.ts"

And the content should be placed in its own file at the path: docs/snippets/logger/basicUsage.ts.

This applies to all TypeScript code snippets of the page.

Got a suggestion in mind?

No response

Acknowledgment

  • I understand the final update might be different from my proposed suggestion, or refused.
@dreamorosi dreamorosi added documentation Improvements or additions to documentation triage This item has not been triaged by a maintainer, please wait help-wanted We would really appreciate some support from community for this one confirmed The scope is clear, ready for implementation and removed triage This item has not been triaged by a maintainer, please wait labels Jan 10, 2023
@dreamorosi
Copy link
Contributor Author

Here:

  1. basicUsage.ts
  2. sam.ts
  3. middy.ts
  4. decorator.ts
  5. manual.ts
  6. eventMiddy.ts
  7. eventDecorator.ts
  8. appendKeys.ts
  9. clearStateMiddy.ts
  10. clearStateDecorator.ts
  11. extraData.ts
  12. logError.ts
  13. createChild.ts
  14. logSampling.ts
  15. bringYourOwnFormatterHandler.ts
  16. bringYourOwnFormatterClass.ts
  17. unitTesting.ts

@dreamorosi dreamorosi moved this from Backlog to Working on it in AWS Lambda Powertools for TypeScript Jan 12, 2023
@dreamorosi dreamorosi removed the help-wanted We would really appreciate some support from community for this one label Jan 12, 2023
@niko-achilles
Copy link
Contributor

How can we improve?
The code snippets should be extracted to their own separate files, placed under docs/snippets/tracer.

Please correct the path docs/snippets/tracer under How can we improve ? in #1220 (comment). It should be as I assume docs/snippets/logger

So for acceptance we have the 17 named code snippets : #1220 (comment)

and the location docs/snippets/logger of the Logger code snippets .

Is that ok @dreamorosi ?

@dreamorosi
Copy link
Contributor Author

Yes, that's okay.

Corrected.

niko-achilles added a commit to niko-achilles/aws-lambda-powertools-typescript that referenced this issue Jan 12, 2023
@dreamorosi dreamorosi linked a pull request Jan 13, 2023 that will close this issue
13 tasks
@dreamorosi dreamorosi added completed This item is complete and has been merged/shipped and removed confirmed The scope is clear, ready for implementation labels Jan 13, 2023
@dreamorosi dreamorosi moved this from Working on it to Shipped in AWS Lambda Powertools for TypeScript Jan 13, 2023
@github-project-automation github-project-automation bot moved this from Shipped to Coming soon in AWS Lambda Powertools for TypeScript Jan 13, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in AWS Lambda Powertools for TypeScript Jan 13, 2023
@github-actions
Copy link
Contributor

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed This item is complete and has been merged/shipped documentation Improvements or additions to documentation
Projects
None yet
2 participants