MCPcopy
hub / github.com/codeaashu/claude-code / flushLogs

Function flushLogs

src/services/analytics/datadog.ts:102–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

100let datadogInitialized: boolean | null = null
101
102async function flushLogs(): Promise<void> {
103 if (logBatch.length === 0) return
104
105 const logsToSend = logBatch
106 logBatch = []
107
108 try {
109 await axios.post(DATADOG_LOGS_ENDPOINT, logsToSend, {
110 headers: {
111 'Content-Type': 'application/json',
112 'DD-API-KEY': DATADOG_CLIENT_TOKEN,
113 },
114 timeout: NETWORK_TIMEOUT_MS,
115 })
116 } catch (error) {
117 logError(error)
118 }
119}
120
121function scheduleFlush(): void {
122 if (flushTimer) return

Callers 3

scheduleFlushFunction · 0.85
shutdownDatadogFunction · 0.85
trackDatadogEventFunction · 0.85

Calls 2

postMethod · 0.80
logErrorFunction · 0.50

Tested by

no test coverage detected