* fix(diagnostics): include desktop app logs Settings diagnostics now collect the Electron main-process log separately from daemon.log so desktop startup and environment-probe failures are included in app reports. * refactor(desktop): share log tail reader * fix(diagnostics): surface desktop app log read errors * refactor(diagnostics): tighten desktop report API
18 lines
410 B
TypeScript
18 lines
410 B
TypeScript
import log from "electron-log/main";
|
|
import { tailFile } from "./tail-file.js";
|
|
|
|
const APP_LOG_TAIL_LINES = 100;
|
|
|
|
export interface DesktopAppLogs {
|
|
logPath: string;
|
|
contents: string;
|
|
}
|
|
|
|
export function getDesktopAppLogs(): DesktopAppLogs {
|
|
const logPath = log.transports.file.getFile().path;
|
|
return {
|
|
logPath,
|
|
contents: tailFile(logPath, APP_LOG_TAIL_LINES, { throwOnReadError: true }),
|
|
};
|
|
}
|