mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
23 lines
523 B
TypeScript
23 lines
523 B
TypeScript
"use strict";
|
|
|
|
import fs = require('fs');
|
|
import dateUtils = require('../../services/date_utils');
|
|
import dataDir = require('../../services/data_dir');
|
|
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
|
|
};
|