mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
Merge branch 'main' into main
This commit is contained in:
commit
2cf20332f4
14 changed files with 61 additions and 145 deletions
|
@ -176,5 +176,11 @@
|
|||
},
|
||||
"modal": {
|
||||
"close": "Закрыть"
|
||||
},
|
||||
"splash": {
|
||||
"downloading_version": "Загрузка версии {{version}}",
|
||||
"searching_updates": "Поиск обновлений",
|
||||
"update_found": "Найдена новая версия {{version}}",
|
||||
"restarting_and_applying": "Перезапуск и внесение изменений"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -174,5 +174,11 @@
|
|||
},
|
||||
"modal": {
|
||||
"close": "关闭按钮"
|
||||
},
|
||||
"splash": {
|
||||
"downloading_version": "正在下载新版本 {{version}}",
|
||||
"searching_updates": "检查更新...",
|
||||
"update_found": "有新版本 {{version}} 可用",
|
||||
"restarting_and_applying": "重启并应用更新"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,30 @@
|
|||
import winston from "winston";
|
||||
import { app } from "electron";
|
||||
import log from "electron-log";
|
||||
import path from "path";
|
||||
|
||||
export const logger = winston.createLogger({
|
||||
level: "info",
|
||||
format: winston.format.json(),
|
||||
transports: [
|
||||
new winston.transports.File({ filename: "error.log", level: "error" }),
|
||||
new winston.transports.File({ filename: "info.log", level: "info" }),
|
||||
new winston.transports.File({ filename: "combined.log" }),
|
||||
],
|
||||
const logsPath = app.isPackaged
|
||||
? path.join(app.getAppPath(), "..", "..", "logs")
|
||||
: path.join(app.getAppPath(), "logs");
|
||||
|
||||
log.transports.file.resolvePathFn = (
|
||||
_: log.PathVariables,
|
||||
message?: log.LogMessage | undefined
|
||||
) => {
|
||||
if (message?.level === "error") {
|
||||
return path.join(logsPath, "error.txt");
|
||||
}
|
||||
|
||||
if (message?.level === "info") {
|
||||
return path.join(logsPath, "info.txt");
|
||||
}
|
||||
|
||||
return path.join(logsPath, "logs.txt");
|
||||
};
|
||||
|
||||
log.errorHandler.startCatching({
|
||||
showDialog: false,
|
||||
});
|
||||
|
||||
log.initialize();
|
||||
|
||||
export const logger = log.scope("main");
|
||||
|
|
3
src/renderer/src/logger/index.ts
Normal file
3
src/renderer/src/logger/index.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
import log from "electron-log/renderer";
|
||||
|
||||
export const logger = log.scope("renderer");
|
Loading…
Add table
Add a link
Reference in a new issue