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(logger): JSDOCS support #491

Merged
merged 15 commits into from
Jan 20, 2022
Merged

feat(logger): JSDOCS support #491

merged 15 commits into from
Jan 20, 2022

Conversation

saragerion
Copy link
Contributor

@saragerion saragerion commented Jan 19, 2022

Description of your changes

Added support for JSDOCS: https://jsdoc.app

How to verify this change

N/A.

Related issues, RFCs

#354

PR status

Is this ready for review?: YES
Is it a breaking change?: NO

Checklist

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • The code coverage hasn't decreased
  • I have added tests that prove my change is effective and works
  • New and existing unit tests pass locally and in Github Actions
  • Any dependent changes have been merged and published in downstream module
  • The PR title follows the conventional commit semantics

Breaking change checklist

N/A


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

@saragerion saragerion changed the title feat(logger): JSDOCS support [WIP] feat(logger): JSDOCS support Jan 19, 2022
@saragerion saragerion changed the title [WIP] feat(logger): JSDOCS support feat(logger): JSDOCS support Jan 19, 2022
@saragerion saragerion added documentation Improvements or additions to documentation logger This item relates to the Logger Utility labels Jan 19, 2022
@saragerion saragerion added this to the production-ready-release milestone Jan 19, 2022
@saragerion saragerion linked an issue Jan 19, 2022 that may be closed by this pull request
packages/logger/src/config/EnvironmentVariablesService.ts Outdated Show resolved Hide resolved
@@ -1,6 +1,13 @@
import type { Logger } from '../Logger';
import middy from '@middy/core';

/**
* Middy middleware that adds the current Lambda invocation's context
* inside all log items.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an example can be useful here , and can will be more in line with what we have in tracer for instance: https://github.com/awslabs/aws-lambda-powertools-typescript/blob/main/packages/tracing/src/middleware/middy.ts#L15

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, well spotted!

Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some minor comments/suggestion and looking forward to merge this!

@@ -18,6 +18,30 @@ import type {
PowertoolLogData,
} from './types';

/**
*
* # Logger class
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd consider removing this since once rendered there's already a heading (see image below):
image

packages/logger/src/Logger.ts Show resolved Hide resolved
packages/logger/src/Logger.ts Outdated Show resolved Hide resolved
packages/logger/src/Logger.ts Show resolved Hide resolved
packages/logger/src/Logger.ts Outdated Show resolved Hide resolved
packages/logger/src/Logger.ts Outdated Show resolved Hide resolved
packages/logger/src/Logger.ts Outdated Show resolved Hide resolved
* information in all log items.
* The decorator can be used only when attached to a Lambda function handler which
* is written as method of a class, and should be declared just before the handler declaration.
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a slightly more involved method perhaps we can provide a code example?

image

packages/logger/src/Logger.ts Outdated Show resolved Hide resolved
packages/logger/src/Logger.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing job!

@saragerion saragerion merged commit cd2c2d9 into main Jan 20, 2022
@saragerion saragerion deleted the feat/jsdocs branch January 20, 2022 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation logger This item relates to the Logger Utility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: logger jsdocs support
3 participants