refactor(desktop): use electron-log in shell-env and simplify env merging (#26284)

This commit is contained in:
Brendan Allan
2026-05-08 13:34:53 +08:00
committed by GitHub
parent 30868f52ea
commit dd8bb44d1d
3 changed files with 20 additions and 17 deletions
+5 -1
View File
@@ -1,3 +1,4 @@
import { MainLogger } from "electron-log"
import log from "electron-log/main.js"
import { readFileSync, readdirSync, statSync, unlinkSync } from "node:fs"
import { dirname, join } from "node:path"
@@ -5,11 +6,14 @@ import { dirname, join } from "node:path"
const MAX_LOG_AGE_DAYS = 7
const TAIL_LINES = 1000
let logger: MainLogger
export const getLogger = () => logger
export function initLogging() {
log.transports.file.maxSize = 5 * 1024 * 1024
initConsoleTransport()
cleanup()
return log
return (logger = log)
}
export function tail(): string {