Skip to content

fix(cli): write logger trace output to file by default#14022

Merged
hardfist merged 1 commit into
mainfrom
codex/logger-trace-file-default
May 13, 2026
Merged

fix(cli): write logger trace output to file by default#14022
hardfist merged 1 commit into
mainfrom
codex/logger-trace-file-default

Conversation

@hardfist
Copy link
Copy Markdown
Contributor

Summary

  • write the default logger tracing layer output to .rspack-profile-${timestamp}-${pid}/rspack.log instead of stdout
  • keep explicit RSPACK_TRACE_OUTPUT=stdout|stderr support
  • update profile tests and sync the English/Chinese tracing docs with the current behavior

Related links

None.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Validation

  • pnpm install --frozen-lockfile
  • pnpm run build:binding:dev
  • pnpm run build:js
  • pnpm --filter @rspack/cli exec rstest run tests/build/profile/profile.test.ts --testTimeout 60000
  • pnpm prettier --check packages/rspack-cli/src/utils/profile.ts packages/rspack-cli/tests/build/profile/profile.test.ts packages/rspack/src/trace/index.ts website/docs/en/contribute/development/tracing.md website/docs/zh/contribute/development/tracing.md website/docs/en/guide/optimization/profile.mdx website/docs/zh/guide/optimization/profile.mdx
  • pnpm --dir website run check:spell
  • git diff --check

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 12, 2026

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7fc08c0
Status: ✅  Deploy successful!
Preview URL: https://d3db437e.rspack-v2.pages.dev
Branch Preview URL: https://codex-logger-trace-file-defa.rspack-v2.pages.dev

View logs

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

📦 Binary Size-limit

Comparing 7fc08c0 to chore: add draft release notes skill (#14028) by neverland

🙈 Size remains the same at 61.93MB

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Rsdoctor Bundle Diff Analysis

Found 6 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
popular-libs 1.7 MB 0
react-1k 826.3 KB 0
react-5k 2.7 MB 0
react-10k 5.7 MB 0
ui-components 4.8 MB 0
rome 1.6 MB 0

Generated by Rsdoctor GitHub Action

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 12, 2026

Merging this PR will improve performance by 30.22%

⚡ 1 improved benchmark
✅ 33 untouched benchmarks
⏩ 25 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation js@Traverse compilation.modules 80.3 µs 61.7 µs +30.22%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing codex/logger-trace-file-default (7fc08c0) with main (ccdadab)

Open in CodSpeed

Footnotes

  1. 25 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions github-actions Bot added the release: bug fix release: bug related release(mr only) label May 12, 2026
@hardfist hardfist marked this pull request as ready for review May 12, 2026 12:03
Copilot AI review requested due to automatic review settings May 12, 2026 12:03
@hardfist hardfist enabled auto-merge (squash) May 12, 2026 12:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR changes Rspack CLI tracing so the default logger layer output is written to a file under the generated profile directory instead of printing to stdout, and updates docs/tests to match.

Changes:

  • Default logger trace output now writes to .rspack-profile-${timestamp}-${pid}/rspack.log (with stdout|stderr still supported when explicitly configured).
  • Updated profile-related tests to assert file output instead of stdout output.
  • Updated English/Chinese tracing and profiling docs to reflect the new default output behavior and output path resolution.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
website/docs/zh/guide/optimization/profile.mdx Updates zh profiling guide to describe rspack.log default and Perfetto output.
website/docs/zh/contribute/development/tracing.md Updates zh tracing docs for new default outputs and relative-path resolution behavior.
website/docs/en/guide/optimization/profile.mdx Updates en profiling guide to describe rspack.log default and Perfetto output.
website/docs/en/contribute/development/tracing.md Updates en tracing docs for new default outputs and relative-path resolution behavior.
packages/rspack/src/trace/index.ts Updates comments describing JS tracer behavior/output naming.
packages/rspack-cli/tests/build/profile/profile.test.ts Updates tests to assert traces go to files by default and refactors cleanup.
packages/rspack-cli/src/utils/profile.ts Implements new default output paths and avoids directory creation for stdout/stderr.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/rspack-cli/tests/build/profile/profile.test.ts Outdated
Comment thread packages/rspack-cli/src/utils/profile.ts
Comment thread website/docs/en/contribute/development/tracing.md Outdated
Comment thread packages/rspack-cli/src/utils/profile.ts Outdated
Comment thread website/docs/en/guide/optimization/profile.mdx Outdated
@hardfist hardfist force-pushed the codex/logger-trace-file-default branch from 8b67dfa to cd1198a Compare May 13, 2026 04:08
@hardfist hardfist force-pushed the codex/logger-trace-file-default branch from cd1198a to 7fc08c0 Compare May 13, 2026 04:53
@hardfist hardfist disabled auto-merge May 13, 2026 05:04
@hardfist hardfist enabled auto-merge (squash) May 13, 2026 05:05
@hardfist hardfist merged commit 3c6700c into main May 13, 2026
35 checks passed
@hardfist hardfist deleted the codex/logger-trace-file-default branch May 13, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants