browser: forward remaining log arguments to write in asObject mode - #2496
Open
SnowingFox wants to merge 1 commit into
Open
browser: forward remaining log arguments to write in asObject mode#2496SnowingFox wants to merge 1 commit into
SnowingFox wants to merge 1 commit into
Conversation
luantaraschi
approved these changes
Aug 13, 2026
luantaraschi
left a comment
There was a problem hiding this comment.
I reproduced the reported behavior against the parent commit: the custom write function received only the formatted log object. At this head it also receives the untouched { di: 'da' } argument, while the formatted object still contains the expected level, message, and timestamp.
I also ran the complete test/browser.test.js file (196 assertions), ESLint on the changed files, and git diff --check. All passed. The change is limited to forwarding the arguments that remain after the log object is formatted, consistent with the existing asObjectBindingsOnly path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2244
Problem
When a custom
browser.writeis used (which forcesasObjectmode), extra arguments passed to the log methods never reach thewritefunction:Here
{ di: 'da' }is silently dropped:logParamsis always empty becauseasObject()only returns the formatted log object.asObjectBindingsOnlymode already forwards the remaining arguments (return [formattedLogObject, ...argsCloned]), but the regularasObjectbranch dropped them.Change
Mirror the
asObjectBindingsOnlybranch inbrowser.jsand return the remaining (unconsumed) arguments alongside the formatted log object:Verification
Added a regression test in
test/browser.test.js:logger.info('test', { di: 'da' })now callswrite(logObj, { di: 'da' }).The new test fails on
mainand passes with this change: