( eventName: string, // intentionally no strings unless AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, // to avoid accidentally logging code/filepaths metadata: LogEventMetadata, )
| 131 | * If no sink is attached, events are queued and drained when the sink attaches. |
| 132 | */ |
| 133 | export function logEvent( |
| 134 | eventName: string, |
| 135 | // intentionally no strings unless AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 136 | // to avoid accidentally logging code/filepaths |
| 137 | metadata: LogEventMetadata, |
| 138 | ): void { |
| 139 | if (sink === null) { |
| 140 | eventQueue.push({ eventName, metadata, async: false }) |
| 141 | return |
| 142 | } |
| 143 | sink.logEvent(eventName, metadata) |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * Log an event to analytics backends (asynchronous) |
no test coverage detected