Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces the initial support for a custom logger in Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for a custom logger through the config.customLogger option. The changes are well-implemented, correctly wiring the custom logger into the Rsbuild instance and exposing it via api.logger. The new e2e tests provide good coverage for this new functionality. The code modifications are clean and consistent with the goal of this feature. I have no further feedback as the changes look good.
There was a problem hiding this comment.
Pull request overview
Adds initial support for per-Rsbuild-instance loggers in @rsbuild/core by introducing config.customLogger, storing the chosen logger on the internal context, and exposing it to plugins via api.logger.
Changes:
- Add
customLogger?: LoggertoRsbuildConfigand store the instance onInternalContext. - Wire
api.loggertocontext.logger(instead of the shared default logger singleton). - Update/replace e2e coverage to validate default vs custom logger behavior and
logLevelapplication.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/types/plugin.ts | Updates plugin API docs for api.logger to describe per-instance behavior. |
| packages/core/src/types/context.ts | Adds logger: Logger to InternalContext type. |
| packages/core/src/types/config.ts | Introduces config.customLogger option in public config typing. |
| packages/core/src/initPlugins.ts | Exposes context.logger through api.logger. |
| packages/core/src/createRsbuild.ts | Chooses customLogger (or default) and applies logLevel to that instance. |
| packages/core/src/createContext.ts | Stores selected logger on the created internal context; uses it for readonly-context assignment errors. |
| e2e/cases/plugin-api/logger/src/index.js | Removes old logger API e2e fixture content. |
| e2e/cases/plugin-api/logger/index.test.ts | Removes old e2e test that asserted api.logger === logger only. |
| e2e/cases/custom-logger/config-option/src/index.js | Adds a minimal entry file for the new e2e case. |
| e2e/cases/custom-logger/config-option/index.test.ts | Adds e2e tests for default/custom api.logger and logLevel behavior with customLogger. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2b5a12860
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
This PR introduces the first part of
customLoggersupport in@rsbuild/core.It adds a
config.customLoggeroption and wires it into the current Rsbuild instance so the logger can be associated with internal context and exposed throughapi.logger.Scope
This is only the first part of the change.
In this PR,
customLoggeris connected to:It does not yet switch all internal core modules to use
context.logger. That follow-up will be handled separately.Related Links
#7353
Checklist