mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 10:32:27 +08:00
refactor(backend_log): use path.join for log file path
This commit is contained in:
parent
06ebcc210e
commit
eb4b5a44df
@ -1,14 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
import { readFile } from "fs/promises";
|
||||
import { join } from "path";
|
||||
import dateUtils from "../../services/date_utils.js";
|
||||
import dataDir from "../../services/data_dir.js";
|
||||
const { LOG_DIR } = dataDir;
|
||||
|
||||
async function getBackendLog() {
|
||||
const file = `${LOG_DIR}/trilium-${dateUtils.localNowDate()}.log`;
|
||||
|
||||
try {
|
||||
const file = join(LOG_DIR, `trilium-${dateUtils.localNowDate()}.log`);
|
||||
return await readFile(file, "utf8");
|
||||
} catch (e) {
|
||||
// most probably the log file does not exist yet - https://github.com/zadam/trilium/issues/1977
|
||||
|
Loading…
x
Reference in New Issue
Block a user