Skip to content

Commit c9c560e

Browse files
authored
docs: fix tracing title (#10106)
* docs: fix tracing title * chore: add rsbuild
1 parent db1fb0e commit c9c560e

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

website/docs/en/contribute/development/tracing.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
## Tracing
1+
# Tracing
22

33
[`tracing`](https://crates.io/crates/tracing) is used to record the internal processes of Rspack compilation, which can be used for performance analysis as well as narrow down the location of a bug.
44

5-
### Enabling Tracing
5+
## Enabling Tracing
66

77
Tracing can be enabled in two ways:
88

9-
- If using `@rspack/cli`: Enable it by setting the `RSPACK_PROFILE` environment variable
9+
- If using `@rspack/cli` or Rsbuild: Enable it by setting the `RSPACK_PROFILE` environment variable
1010
- If directly using `@rspack/core`: Enable it through `rspack.experiments.globalTrace.register` and `rspack.experiments.globalTrace.cleanup`. You can check [how we implement `RSPACK_PROFILE` in `@rspack/cli`](https://github.com/web-infra-dev/rspack/blob/9be47217b5179186b0825ca79990ab2808aa1a0f/packages/rspack-cli/src/utils/profile.ts#L219-L224) for more information.
1111

1212
The generated `trace.json` file can be viewed and analyzed in [ui.perfetto.dev](https://ui.perfetto.dev/).
1313

14-
### Tracing Layer
14+
## Tracing Layer
1515

1616
Rspack supports two types of layers: `chrome` and `logger`:
1717

@@ -26,7 +26,7 @@ RSPACK_TRACE_LAYER=logger
2626
RSPACK_TRACE_LAYER=chrome
2727
```
2828

29-
### Tracing Output
29+
## Tracing Output
3030

3131
You can specify the output location for traces:
3232

@@ -40,7 +40,7 @@ RSPACK_TRACE_LAYER=logger RSPACK_TRACE_OUTPUT=./log.txt rspack dev
4040
RSPACK_TRACE_LAYER=chrome RSPACK_TRACE_OUTPUT=./perfetto.json rspack dev
4141
```
4242

43-
### Tracing Filter
43+
## Tracing Filter
4444

4545
You can configure the data to be filtered through `RSPACK_PROFILE`. Rspack provides two preset options:
4646

@@ -49,7 +49,7 @@ You can configure the data to be filtered through `RSPACK_PROFILE`. Rspack provi
4949

5050
Apart from the presets, other strings will be passed directly to [Env Filter](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax), supporting more complex filtering strategies:
5151

52-
#### Tracing Level Filter
52+
### Tracing Level Filter
5353

5454
The supported tracing levels are: `TRACE`, `DEBUG`, `INFO`, `WARN`, and `ERROR`. You can filter by level:
5555

@@ -60,14 +60,14 @@ RSPACK_PROFILE=trace
6060
RSPACK_PROFILE=info
6161
```
6262

63-
#### Module Level Filtering
63+
### Module Level Filtering
6464

6565
```sh
6666
# View rspack_resolver logs and output to terminal
6767
RSPACK_TRACE_LAYER=logger RSPACK_PROFILE=rspack_resolver
6868
```
6969

70-
#### Mixed Filtering
70+
### Mixed Filtering
7171

7272
EnvFilter supports mixed use of multiple filtering conditions to implement more complex filtering strategies:
7373

website/docs/zh/contribute/development/tracing.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## Tracing
1+
# Tracing
22

33
[`tracing`](https://crates.io/crates/tracing) 用于记录 Rspack 编译的内部流程,既可用于性能分析,也可用于定位 Bug。
44

5-
### 开启 Tracing
5+
## 开启 Tracing
66

77
可以通过以下两种方式开启 tracing:
88

@@ -11,7 +11,7 @@
1111

1212
生成的 `trace.json` 文件可以在 [ui.perfetto.dev](https://ui.perfetto.dev/) 中查看和分析。
1313

14-
### Tracing Layer
14+
## Tracing Layer
1515

1616
Rspack 支持 `chrome``logger` 两种 layer:
1717

@@ -26,7 +26,7 @@ RSPACK_TRACE_LAYER=logger
2626
RSPACK_TRACE_LAYER=chrome
2727
```
2828

29-
### Tracing Output
29+
## Tracing Output
3030

3131
可以指定 trace 的输出位置:
3232

@@ -40,7 +40,7 @@ RSPACK_TRACE_LAYER=logger RSPACK_TRACE_OUTPUT=log.txt rspack dev
4040
RSPACK_TRACE_LAYER=chrome RSPACK_TRACE_OUTPUT=perfetto.json rspack dev
4141
```
4242

43-
### Tracing Filter
43+
## Tracing Filter
4444

4545
通过 `RSPACK_PROFILE` 可以配置需要过滤的数据。Rspack 提供了两个预设的 `preset`
4646

@@ -49,7 +49,7 @@ RSPACK_TRACE_LAYER=chrome RSPACK_TRACE_OUTPUT=perfetto.json rspack dev
4949

5050
除了预设外,其他字符串都会透传给 [Env Filter](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax),支持更复杂的过滤策略:
5151

52-
#### Tracing Level Filter
52+
### Tracing Level Filter
5353

5454
支持的 tracing 等级有:`TRACE``DEBUG``INFO``WARN``ERROR`。可以通过等级进行过滤:
5555

@@ -60,14 +60,14 @@ RSPACK_PROFILE=trace
6060
RSPACK_PROFILE=info
6161
```
6262

63-
#### 模块级别过滤
63+
### 模块级别过滤
6464

6565
```sh
6666
# 查看 rspack_resolver 的日志,并输出到终端
6767
RSPACK_TRACE_LAYER=logger RSPACK_PROFILE=rspack_resolver
6868
```
6969

70-
#### 混合过滤
70+
### 混合过滤
7171

7272
EnvFilter 支持混合使用多种过滤条件,实现更复杂的过滤策略:
7373

0 commit comments

Comments
 (0)