( config: Config, event: FlashFallbackEvent, )
| 172 | } |
| 173 | |
| 174 | export function logFlashFallback( |
| 175 | config: Config, |
| 176 | event: FlashFallbackEvent, |
| 177 | ): void { |
| 178 | ClearcutLogger.getInstance(config)?.logFlashFallbackEvent(event); |
| 179 | if (!isTelemetrySdkInitialized()) return; |
| 180 | |
| 181 | const attributes: LogAttributes = { |
| 182 | ...getCommonAttributes(config), |
| 183 | ...event, |
| 184 | 'event.name': EVENT_FLASH_FALLBACK, |
| 185 | 'event.timestamp': new Date().toISOString(), |
| 186 | }; |
| 187 | |
| 188 | const logger = logs.getLogger(SERVICE_NAME); |
| 189 | const logRecord: LogRecord = { |
| 190 | body: `Switching to flash as Fallback.`, |
| 191 | attributes, |
| 192 | }; |
| 193 | logger.emit(logRecord); |
| 194 | } |
| 195 | |
| 196 | export function logApiError(config: Config, event: ApiErrorEvent): void { |
| 197 | const uiEvent = { |
no test coverage detected