Skip to content

Maintenance: add missing resetKeys method to LoggerInterface #3212

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

Closed
ralbertazzi opened this issue Oct 17, 2024 · 5 comments · Fixed by #3213
Closed

Maintenance: add missing resetKeys method to LoggerInterface #3212

ralbertazzi opened this issue Oct 17, 2024 · 5 comments · Fixed by #3213
Assignees
Labels
completed This item is complete and has been merged/shipped help-wanted We would really appreciate some support from community for this one logger This item relates to the Logger Utility not-a-bug New and existing bug reports incorrectly submitted as bug

Comments

@ralbertazzi
Copy link
Contributor

Expected Behavior

Being able to call logger.resetKeys() without getting typescript compilation errors.

Current Behavior

logger.resetKeys() results in a typescript error Property 'resetKeys' does not exist on type 'Logger'. I believe this is because LoggerInterface does not define resetKeys().

Code snippet

const logger = new Logger();
logger.resetKeys();

Steps to Reproduce

Compile with Typescript strict settings

Possible Solution

No response

Powertools for AWS Lambda (TypeScript) version

latest

AWS Lambda function runtime

20.x

Packaging format used

npm

Execution logs

No response

@ralbertazzi ralbertazzi added bug Something isn't working triage This item has not been triaged by a maintainer, please wait labels Oct 17, 2024
@dreamorosi
Copy link
Contributor

Hi, thanks for opening this issue.

The method is indeed missing from the interface, however I am both unable to reproduce the issue using the steps you described and inclined to change the definition of this issue.

Because this is, by definition, a compile time error - it's not a bug under the classification for this project (aka bugs must [...] produces [sic] incorrect or unexpected results at runtime that differ from its intended behavior.).

In terms of reproducing the bug, I just started a new sample project from scratch and using the tsconfig.json below, which includes "strict": true I am able to compile the code (by running npx tsc -p tsconfig.json) you mentioned above without seeing any error.

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "lib": [
      "es2022"
    ],
    "declaration": true,
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "noImplicitThis": true,
    "alwaysStrict": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": false,
    "inlineSourceMap": true,
    "inlineSources": true,
    "experimentalDecorators": true,
    "strictPropertyInitialization": false,
  },
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "node_modules",
    "cdk.out"
  ]
}

We'll be adding the missing method to the interface, however it'd be helpful to understand the use case to see if there's anything else we are missing and can improve in our docs.

@dreamorosi dreamorosi added logger This item relates to the Logger Utility not-a-bug New and existing bug reports incorrectly submitted as bug confirmed The scope is clear, ready for implementation and removed bug Something isn't working triage This item has not been triaged by a maintainer, please wait labels Oct 17, 2024
@dreamorosi dreamorosi changed the title Bug: LoggerInterface is missing resetKeys Maintenance: add missing resetKeys method to LoggerInterface Oct 17, 2024
@dreamorosi dreamorosi added the help-wanted We would really appreciate some support from community for this one label Oct 17, 2024
@dreamorosi dreamorosi moved this from Triage to Backlog in Powertools for AWS Lambda (TypeScript) Oct 17, 2024
@dreamorosi
Copy link
Contributor

Also, I have added this to the backlog and added the help-wanted label.

If you want to ensure that it will included in the next release (next Tuesday), feel free to send a PR and I'll be happy to help you get it merged.

@ralbertazzi
Copy link
Contributor Author

There you go ;) #3213

@dreamorosi dreamorosi linked a pull request Oct 17, 2024 that will close this issue
@dreamorosi dreamorosi moved this from Backlog to Working on it in Powertools for AWS Lambda (TypeScript) Oct 17, 2024
@github-project-automation github-project-automation bot moved this from Working on it to Coming soon in Powertools for AWS Lambda (TypeScript) Oct 17, 2024
Copy link
Contributor

⚠️ COMMENT VISIBILITY WARNING ⚠️

This issue is now closed. Please be mindful that future comments 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.

@dreamorosi dreamorosi added pending-release This item has been merged and will be released soon and removed confirmed The scope is clear, ready for implementation labels Oct 17, 2024
Copy link
Contributor

This is now released under v2.10.0 version!

@github-actions github-actions bot added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon labels Oct 23, 2024
@dreamorosi dreamorosi moved this from Coming soon to Shipped in Powertools for AWS Lambda (TypeScript) Oct 23, 2024
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 help-wanted We would really appreciate some support from community for this one logger This item relates to the Logger Utility not-a-bug New and existing bug reports incorrectly submitted as bug
Projects
Development

Successfully merging a pull request may close this issue.

2 participants