Include desktop app logs in diagnostics (#1914)
* 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
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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 }),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user