mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
23 lines
511 B
TypeScript
23 lines
511 B
TypeScript
"use strict";
|
|
|
|
import fs from "fs";
|
|
import dateUtils from "../../services/date_utils.js";
|
|
import dataDir from "../../services/data_dir.js";
|
|
const { LOG_DIR } = dataDir;
|
|
|
|
function getBackendLog() {
|
|
const file = `${LOG_DIR}/trilium-${dateUtils.localNowDate()}.log`;
|
|
|
|
try {
|
|
return fs.readFileSync(file, 'utf8');
|
|
}
|
|
catch (e) {
|
|
// most probably the log file does not exist yet - https://github.com/zadam/trilium/issues/1977
|
|
return "";
|
|
}
|
|
}
|
|
|
|
export = {
|
|
getBackendLog
|
|
};
|