MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / handleLogs

Function handleLogs

src/cli/commands/daemon.ts:256–277  ·  view source on GitHub ↗
(workspaceKey: string, tail: number)

Source from the content-addressed store, hash-verified

254}
255
256async function handleLogs(workspaceKey: string, tail: number): Promise<void> {
257 const entry = readDaemonRegistryEntry(workspaceKey);
258 const logPath = entry?.logPath;
259
260 if (!logPath) {
261 writeLine('No daemon log path available for this workspace.');
262 return;
263 }
264
265 let content = '';
266 try {
267 content = readFileSync(logPath, 'utf8');
268 } catch (err) {
269 console.error('Error:', err instanceof Error ? err.message : String(err));
270 process.exitCode = 1;
271 return;
272 }
273
274 const lines = content.split(/\r?\n/);
275 const limited = lines.slice(Math.max(0, lines.length - Math.max(1, tail)));
276 writeLine(limited.join('\n'));
277}
278
279async function handleList(jsonOutput: boolean, includeStale: boolean): Promise<void> {
280 const registryEntries = listDaemonRegistryEntries();

Callers 1

registerDaemonCommandsFunction · 0.85

Calls 2

readDaemonRegistryEntryFunction · 0.90
writeLineFunction · 0.70

Tested by

no test coverage detected