Skip to content

Nest logger doesn’t log unhandled errors properly#80

Merged
dario-fazio merged 6 commits intomainfrom
#79-nest-logger
Mar 24, 2026
Merged

Nest logger doesn’t log unhandled errors properly#80
dario-fazio merged 6 commits intomainfrom
#79-nest-logger

Conversation

@dario-fazio
Copy link
Copy Markdown
Contributor

The NestLogger wrapper incorrectly passed its arguments as an array, which was subsequently not serialised correctly

Copilot AI review requested due to automatic review settings March 19, 2026 16:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes how NestLogger (NestJS LoggerService adapter) forwards log arguments to @shiftcode/logger, so unhandled errors and extra parameters serialize correctly through log transports.

Changes:

  • Updated NestLogger methods to accept variadic optional params instead of wrapping inputs in an array.
  • Adjusted verbose() to forward through debug().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 19, 2026 16:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes argument forwarding in the NestLogger wrapper so NestJS-provided error/metadata parameters are logged as separate arguments (instead of as a single nested array), improving serialization of unhandled errors.

Changes:

  • Update NestLogger methods to accept ...optionalParams and forward them correctly to @shiftcode/logger.
  • Bump @shiftcode/nest-logger prerelease version and update package-lock.json accordingly.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/nest-logger/src/model/nest-logger.ts Forwards logger method arguments via rest params to avoid nested arrays and improve error serialization.
packages/nest-logger/package.json Version bump to 1.0.1-pr79.0.
package-lock.json Lockfile updated to reflect the new @shiftcode/nest-logger version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

 - @shiftcode/nest-logger@1.0.1-pr79.1
Copy link
Copy Markdown

Copilot AI commented Mar 19, 2026

@dario-fazio I've opened a new pull request, #81, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI review requested due to automatic review settings March 19, 2026 17:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes NestLogger argument forwarding so unhandled errors (and other log calls) are passed through as a flat argument list, matching how @shiftcode/logger expects to receive rest params and serialize them.

Changes:

  • Update NestLogger methods to forward message plus ...optionalParams instead of wrapping parameters in an array.
  • Add a focused vitest suite to prevent regressions in argument forwarding behavior.
  • Improve the mock transport typing to capture the structured log call arguments in tests.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/nest-logger/src/model/nest-logger.ts Fixes the core bug by forwarding rest params correctly to @shiftcode/logger.
packages/nest-logger/src/model/nest-logger.spec.ts Adds regression tests asserting args are flat (not nested) for all log levels.
packages/nest-logger/test/mock-log.transport.ts Tightens test transport typing to make assertions safer/clearer.
packages/nest-logger/package.json Bumps package version for PR prerelease.
package-lock.json Updates lockfile to reflect the package version bump.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

 - @shiftcode/nest-logger@1.0.1-pr79.2
Copy link
Copy Markdown
Contributor

@mumenthalers mumenthalers left a comment

Choose a reason for hiding this comment

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

lgtm

@dario-fazio dario-fazio merged commit 6dfd425 into main Mar 24, 2026
3 checks passed
@dario-fazio dario-fazio deleted the #79-nest-logger branch March 24, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logger provided to nest framework doesn’t log unhandled errors properly

5 participants