The logger option provides custom logging for React Compiler events during compilation.
```js: ${filename}`); } } }
---
## Reference### `logger`Configures custom logging to track compiler behavior and debug issues.
#### Type{ logEvent: (filename: string | null, event: LoggerEvent) => void; } | null
#### Default value`null`
#### Methods- **`logEvent`**: Called for each compiler event with the filename and event details
#### Event types- **`CompileSuccess`**: Function successfully compiled- **`CompileError`**: Function skipped due to errors- **`CompileDiagnostic`**: Non-fatal diagnostic information- **`CompileSkip`**: Function skipped for other reasons- **`PipelineError`**: Unexpected compilation error- **`Timing`**: Performance timing information
#### Caveats- Event structure may change between versions- Large codebases generate many log entries
---
## Usage### Basic loggingTrack compilation success and failures:
```js`); break; } case 'CompileError': { console.log(`❌ Skipped: ${filename}`); break; } default: {} } } }}Detailed error logging
Section titled “Detailed error logging”Get specific information about compilation failures:
```js); console.error(Reason: ${event.detail.reason}`);
if (event.detail.description) { console.error(`Details: ${event.detail.description}`); }
if (event.detail.loc) { const { line, column } = event.detail.loc.start; console.error(`Location: Line ${line}, Column ${column}`); }
if (event.detail.suggestions) { console.error('Suggestions:', event.detail.suggestions); } }}} }