MCPcopy Create free account
hub / github.com/Noumena-Network/code / logEventAsync

Function logEventAsync

src/services/analytics/index.ts:158–169  ·  view source on GitHub ↗
(
  eventName: string,
  // intentionally no strings, to avoid accidentally logging code/filepaths
  metadata: LogEventMetadata,
)

Source from the content-addressed store, hash-verified

156 * If no sink is attached, events are queued and drained when the sink attaches.
157 */
158export async function logEventAsync(
159 eventName: string,
160 // intentionally no strings, to avoid accidentally logging code/filepaths
161 metadata: LogEventMetadata,
162): Promise<void> {
163 const canonicalEventName = toCanonicalAnalyticsName(eventName)
164 if (sink === null) {
165 eventQueue.push({ eventName: canonicalEventName, metadata, async: true })
166 return
167 }
168 await sink.logEventAsync(canonicalEventName, metadata)
169}
170
171/**
172 * Reset analytics state for testing purposes only.

Callers

nothing calls this directly

Calls 1

toCanonicalAnalyticsNameFunction · 0.85

Tested by

no test coverage detected