@@ -4,7 +4,7 @@ title: logger
4
4
5
5
<Intro >
6
6
7
- The ` logger ` option provides custom logging for React Compiler events during compilation.
7
+ ` logger ` 选项在编译期间为 React 编译器事件提供自定义日志记录。
8
8
9
9
</Intro >
10
10
@@ -22,49 +22,49 @@ The `logger` option provides custom logging for React Compiler events during com
22
22
23
23
---
24
24
25
- ## Reference {/* reference* /}
25
+ ## 参考 {/* reference* /}
26
26
27
27
### ` logger ` {/* logger* /}
28
28
29
- Configures custom logging to track compiler behavior and debug issues.
29
+ 配置自定义日志以跟踪编译器行为并调试问题。
30
30
31
- #### Type {/* type* /}
31
+ #### 类型 {/* type* /}
32
32
33
33
```
34
34
{
35
35
logEvent: (filename: string | null, event: LoggerEvent) => void;
36
36
} | null
37
37
```
38
38
39
- #### Default value {/* default-value* /}
39
+ #### 默认值 {/* default-value* /}
40
40
41
41
` null `
42
42
43
- #### Methods {/* methods* /}
43
+ #### 方法 {/* methods* /}
44
44
45
- - ** ` logEvent ` ** : Called for each compiler event with the filename and event details
45
+ - ** ` logEvent ` ** :传入文件名和事件详情来记录每次编译器事件
46
46
47
- #### Event types {/* event-types* /}
47
+ #### 事件类型 {/* event-types* /}
48
48
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 ` ** :性能计时信息
55
55
56
- #### Caveats {/* caveats* /}
56
+ #### 注意事项 {/* caveats* /}
57
57
58
- - Event structure may change between versions
59
- - Large codebases generate many log entries
58
+ - 事件结构可能在不同版本之间发生变化
59
+ - 大型代码库会生成大量日志条目
60
60
61
61
---
62
62
63
- ## Usage {/* usage* /}
63
+ ## 用法 {/* usage* /}
64
64
65
- ### Basic logging {/* basic-logging* /}
65
+ ### 基础日志 {/* basic-logging* /}
66
66
67
- Track compilation success and failures:
67
+ 跟踪编译成功和失败:
68
68
69
69
``` js
70
70
{
@@ -86,9 +86,9 @@ Track compilation success and failures:
86
86
}
87
87
```
88
88
89
- ### Detailed error logging {/* detailed-error-logging* /}
89
+ ### 详细错误日志 {/* detailed-error-logging* /}
90
90
91
- Get specific information about compilation failures:
91
+ 获取编译失败的具体信息:
92
92
93
93
``` js
94
94
{
@@ -115,4 +115,3 @@ Get specific information about compilation failures:
115
115
}
116
116
}
117
117
```
118
-
0 commit comments