File tree Expand file tree Collapse file tree 5 files changed +17
-0
lines changed
packages/rspeedy/core/src/cli Expand file tree Collapse file tree 5 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ export async function build(
3030 const shouldExit = process . env [ 'RSDOCTOR' ] !== 'true' || isCI ( )
3131 const isWatch = buildOptions . watch ?? false
3232
33+ if ( buildOptions . logLevel ) {
34+ logger . level = buildOptions . logLevel
35+ }
36+
3337 let onBeforeRestart : ( ( ) => Promise < void > ) [ ] = [ ]
3438 try {
3539 const { rspeedyConfig, configPath, createRspeedyOptions } = await init (
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export interface CommonOptions {
1919 noEnv ?: boolean
2020 mode ?: RsbuildMode
2121 root ?: string
22+ logLevel ?: 'info' | 'warn' | 'error' | 'silent'
2223}
2324
2425function applyCommonOptions ( command : Command ) {
Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ export async function dev(
2424 cwd : string ,
2525 devOptions : DevOptions ,
2626) : Promise < void > {
27+ if ( devOptions . logLevel ) {
28+ logger . level = devOptions . logLevel
29+ }
30+
2731 let onBeforeRestart : ( ( ) => Promise < void > ) [ ] = [ ]
2832 try {
2933 const { rspeedyConfig, configPath, createRspeedyOptions } = await init (
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ export async function inspect(
2020 cwd : string ,
2121 inspectOptions : InspectOptions ,
2222) : Promise < void > {
23+ if ( inspectOptions . logLevel ) {
24+ logger . level = inspectOptions . logLevel
25+ }
26+
2327 try {
2428 const { createRspeedyOptions } = await init ( cwd , inspectOptions )
2529 const rspeedy = await createRspeedy ( createRspeedyOptions )
Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ export async function preview(
2121 cwd : string ,
2222 previewOptions : PreviewOptions ,
2323) : Promise < void > {
24+ if ( previewOptions . logLevel ) {
25+ logger . level = previewOptions . logLevel
26+ }
27+
2428 try {
2529 const { createRspeedyOptions } = await init ( cwd , previewOptions )
2630
You can’t perform that action at this time.
0 commit comments