Skip to content

Fix: ConsoleLogger.warn/error swallow their second argument - #273

Merged
adrai merged 1 commit into
i18next:mainfrom
pjrobertson:logger-pass-params
Jul 16, 2026
Merged

Fix: ConsoleLogger.warn/error swallow their second argument#273
adrai merged 1 commit into
i18next:mainfrom
pjrobertson:logger-pass-params

Conversation

@pjrobertson

Copy link
Copy Markdown
Contributor

The Logger interface declares warn(message, more?), and ~10 call sites pass a caught error as that second arg (e.g. logger.warn(\Plugin ${plugin.name} extractContextFromExpression
failed:, err)inkey-finder.ts). But ConsoleLogger.warnonly forwarded the message toconsole.warn, so plugin-hook errors printed as a bare ... failed:with no detail (see screenshot). This forwards the optional second arg on bothwarnanderror, leaving single-arg output unchanged.

Adds test/console-logger.test.ts. Note: 2 pre-existing failures in test/status.test.ts are unrelated (fail on main too).

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included
  • commit message and code follows the Developer's Certification of Origin

Checklist (for documentation change)

@adrai
adrai merged commit cada9ca into i18next:main Jul 16, 2026
8 checks passed
@adrai

adrai commented Jul 16, 2026

Copy link
Copy Markdown
Member

thx, included in v1.66.1

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.

2 participants