MCPcopy Index your code
hub / github.com/Microck/opencode-studio / enqueueLogLine

Function enqueueLogLine

server/index.js:145–154  ·  view source on GitHub ↗
(line)

Source from the content-addressed store, hash-verified

143let logReadStream = null;
144
145function enqueueLogLine(line) {
146 const entry = { timestamp: Date.now(), line };
147 logBuffer.push(entry);
148 if (logBuffer.length > LOG_BUFFER_SIZE) logBuffer.shift();
149
150 for (const sub of logSubscribers) {
151 sub.queue.push(`data: ${JSON.stringify(entry)}\n\n`);
152 flushSubscriber(sub);
153 }
154}
155
156function flushSubscriber(sub) {
157 if (sub.draining || sub.closed) return;

Callers 1

processLogLineFunction · 0.85

Calls 1

flushSubscriberFunction · 0.85

Tested by

no test coverage detected