Skip to content

Commit cefd74a

Browse files
authored
ocs(cn): translate /reference/react-compiler/logger into Chinese (#1777)
2 parents a7eaa98 + 00bd475 commit cefd74a

File tree

1 file changed

+22
-23
lines changed
  • src/content/reference/react-compiler

1 file changed

+22
-23
lines changed

src/content/reference/react-compiler/logger.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: logger
44

55
<Intro>
66

7-
The `logger` option provides custom logging for React Compiler events during compilation.
7+
`logger` 选项在编译期间为 React 编译器事件提供自定义日志记录。
88

99
</Intro>
1010

@@ -22,49 +22,49 @@ The `logger` option provides custom logging for React Compiler events during com
2222

2323
---
2424

25-
## Reference {/*reference*/}
25+
## 参考 {/*reference*/}
2626

2727
### `logger` {/*logger*/}
2828

29-
Configures custom logging to track compiler behavior and debug issues.
29+
配置自定义日志以跟踪编译器行为并调试问题。
3030

31-
#### Type {/*type*/}
31+
#### 类型 {/*type*/}
3232

3333
```
3434
{
3535
logEvent: (filename: string | null, event: LoggerEvent) => void;
3636
} | null
3737
```
3838

39-
#### Default value {/*default-value*/}
39+
#### 默认值 {/*default-value*/}
4040

4141
`null`
4242

43-
#### Methods {/*methods*/}
43+
#### 方法 {/*methods*/}
4444

45-
- **`logEvent`**: Called for each compiler event with the filename and event details
45+
- **`logEvent`**:传入文件名和事件详情来记录每次编译器事件
4646

47-
#### Event types {/*event-types*/}
47+
#### 事件类型 {/*event-types*/}
4848

49-
- **`CompileSuccess`**: Function successfully compiled
50-
- **`CompileError`**: Function skipped due to errors
51-
- **`CompileDiagnostic`**: Non-fatal diagnostic information
52-
- **`CompileSkip`**: Function skipped for other reasons
53-
- **`PipelineError`**: Unexpected compilation error
54-
- **`Timing`**: Performance timing information
49+
- **`CompileSuccess`**:函数成功编译
50+
- **`CompileError`**: 由于错误而跳过该函数
51+
- **`CompileDiagnostic`**:非致命的诊断信息
52+
- **`CompileSkip`**: 因其他原因跳过该函数
53+
- **`PipelineError`**: 意外的编译管线错误
54+
- **`Timing`**:性能计时信息
5555

56-
#### Caveats {/*caveats*/}
56+
#### 注意事项 {/*caveats*/}
5757

58-
- Event structure may change between versions
59-
- Large codebases generate many log entries
58+
- 事件结构可能在不同版本之间发生变化
59+
- 大型代码库会生成大量日志条目
6060

6161
---
6262

63-
## Usage {/*usage*/}
63+
## 用法 {/*usage*/}
6464

65-
### Basic logging {/*basic-logging*/}
65+
### 基础日志 {/*basic-logging*/}
6666

67-
Track compilation success and failures:
67+
跟踪编译成功和失败:
6868

6969
```js
7070
{
@@ -86,9 +86,9 @@ Track compilation success and failures:
8686
}
8787
```
8888

89-
### Detailed error logging {/*detailed-error-logging*/}
89+
### 详细错误日志 {/*detailed-error-logging*/}
9090

91-
Get specific information about compilation failures:
91+
获取编译失败的具体信息:
9292

9393
```js
9494
{
@@ -115,4 +115,3 @@ Get specific information about compilation failures:
115115
}
116116
}
117117
```
118-

0 commit comments

Comments
 (0)