You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs: clarify custom reporter arguments and context - #469
Clarify the custom reporter method signature and the normalization of structured message input. This matches ConsolaReporter in src/types.ts and the behavior discussed in #406.
This documentation-only change is independent of #407's type correction and #455's OpenTelemetry example.
Validation: ran a custom reporter against the published consola 3.4.2 package on Node 22. Verified that a structured input with message "hello" and args [42] produces args ["hello", 42], no separate message property, and the second context argument contains options. git diff --check passed; the full test suite was not run.
AI disclosure: ChatGPT investigated, authored, and tested this documentation correction autonomously on behalf of @lxj808624.
Summary by CodeRabbit
Documentation
Clarified the custom reporter’s log method signature and return value.
Updated guidance on reading log arguments and handling structured messages.
No actionable comments were generated in the recent review.
Walkthrough
The README now documents the custom reporter’s log(logObject, context) method, the options in context, and how a nonempty structured message is prepended to logObject.args.
Changes: Custom reporter documentation
Layer / File(s)
Summary
Document reporter contract README.md
The README changes the documented method to log(logObject, context) returning void. It explains that context contains logger options and reporters should read arguments from logObject.args.
unjs/consola#468: This PR changes the reporter message field. The README documents the related structured-input behavior.
Suggested reviewers:pi0
Merge Risk: Minimal · up to cce09
This documentation-only change clarifies the custom reporter method signature and how structured messages are passed to reporters. It does not alter runtime behavior, so there is no meaningful merge risk.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "docs: clarify custom reporter arguments and context" matches the change. The README now documents that the custom reporter's log(logObject, context) method returns void, that context holds …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "docs: clarify custom reporter arguments and context" matches the change. The README now documents that the custom reporter's log(logObject, context) method returns void, that context holds the logger options, and that arguments are read from logObject.args, with a nonempty message prepended. The PR objectives describe the same documentation-only clarification of the reporter signature and structured message normalization. The title names the main change and is specific enough for a teammate scanning history.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 287d3244-0a01-4913-966d-04188051893f
Commits
Reviewing files that changed from the base of the PR and between c47faac and cce094a.
Files selected for processing: 1
README.md
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
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
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.
Clarify the custom reporter method signature and the normalization of structured message input. This matches
ConsolaReporterinsrc/types.tsand the behavior discussed in #406.This documentation-only change is independent of #407's type correction and #455's OpenTelemetry example.
Validation: ran a custom reporter against the published consola 3.4.2 package on Node 22. Verified that a structured input with message "hello" and args [42] produces args ["hello", 42], no separate message property, and the second context argument contains options.
git diff --checkpassed; the full test suite was not run.AI disclosure: ChatGPT investigated, authored, and tested this documentation correction autonomously on behalf of @lxj808624.
Summary by CodeRabbit
logmethod signature and return value.