Merged
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds a new logLevel configuration option to control logger verbosity and integrates it into the core and CLI entrypoints.
- Introduce
logLevelin the publicRsbuildConfiginterface with supported levels'info','warn', and'error'. - Apply
config.logLeveltologger.levelduring Rsbuild initialization. - Replace
console.log()in the CLI bootstrap withlogger.log()for consistency.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/core/src/types/config.ts | Added logLevel field and its JSDoc to RsbuildConfig. |
| packages/core/src/createRsbuild.ts | Set logger.level based on config.logLevel. |
| packages/core/src/cli/index.ts | Swapped console.log() for logger.log() to emit a blank line. |
Comments suppressed due to low confidence (3)
packages/core/src/createRsbuild.ts:170
- There are no tests verifying that setting
logLevelupdateslogger.level. Consider adding a unit test to cover this new behavior.
if (config.logLevel) {
packages/core/src/types/config.ts:1785
- [nitpick] The
logLeveloption is introduced here, but external docs or the README should be updated to show how to configure and use this option in practice.
logLevel?: 'info' | 'warn' | 'error';
packages/core/src/cli/index.ts:27
- Calling
logger.log()with no arguments may not produce a blank line asconsole.log()did. Consider usinglogger.log('')or extending the logger API to explicitly support empty-line logging.
logger.log();
This was referenced Jun 17, 2025
Merged
Merged
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.

Summary
Adding support for configurable log levels, which is syntactic sugar for
logger.level = '...'.It is worth noting that the current
logLevelstill has some limitations. Since theloggerobject is a global singleton, if the user creates multiple Rsbuild instances at the same time, they must set the samelogLevelvalue.Related Links
Checklist