MCPcopy
hub / github.com/anomalyco/opencode / exportDebugLogs

Function exportDebugLogs

packages/desktop/src/main/logging.ts:51–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49}
50
51export async function exportDebugLogs() {
52 const restartNetLog = netLog.currentlyLogging
53 if (restartNetLog) {
54 await netLog.stopLogging().catch((error) => write("network", "failed to stop net log", { error }))
55 }
56
57 const output = join(app.getPath("downloads"), `opencode-debug-${stamp()}.zip`)
58 try {
59 write("main", "exporting debug logs", { output })
60 await writeZip(output, [
61 { name: "manifest.json", data: Buffer.from(JSON.stringify(manifest(), null, 2)) },
62 ...collect(root, "desktop"),
63 ...serverLogRoots().flatMap((dir, i) => collect(dir, `server-${i + 1}`)),
64 ...collect(app.getPath("crashDumps"), "crashpad"),
65 ])
66 shell.showItemInFolder(output)
67 return output
68 } finally {
69 if (restartNetLog) {
70 await startNetLog().catch((error) => write("network", "failed to restart net log", { error }))
71 }
72 }
73}
74
75export function write(
76 name: string,

Callers 2

index.tsFile · 0.90
handleFunction · 0.90

Calls 9

joinFunction · 0.85
writeZipFunction · 0.85
manifestFunction · 0.85
serverLogRootsFunction · 0.85
startNetLogFunction · 0.85
writeFunction · 0.70
stampFunction · 0.70
collectFunction · 0.70
fromMethod · 0.45

Tested by

no test coverage detected