공개된 소스
소스 ZIP 다운로드
CH-J Server Manager
특정 애플리케이션 릴리스의 디렉터리와 파일을 살펴보세요.
CH-J / Server Manager
196 개 파일
core-20261013T133631Z-faa4ab45100e
추가됨: 날짜 기록 없음 · 빌드됨:
1
"use strict";3
const test = require("node:test");4
const assert = require("node:assert/strict");5
const fs = require("node:fs");6
const os = require("node:os");7
const path = require("node:path");8
const { LogService, MAX_LIMIT, normalizeLimit } = require("../src/main/logging/logService");10
test("log service returns a bounded tail without a partial first record", async (t) => {11
const root = fs.mkdtempSync(path.join(os.tmpdir(), "chj-log-"));12
t.after(() => fs.rmSync(root, { recursive: true, force: true }));13
const logPath = path.join(root, "core.log");14
fs.writeFileSync(logPath, "first-record\nsecond-record\nthird-record\n");15
const result = await new LogService(logPath).readTail({ maxBytes: 29 });16
assert.equal(result.text, "second-record\nthird-record\n");17
assert.equal(result.truncated, true);18
assert.equal(result.size, 40);19
assert.match(result.readAt, /^\d{4}-\d{2}-\d{2}T/);20
});22
test("log service handles a missing log and caps read limits", async (t) => {23
const root = fs.mkdtempSync(path.join(os.tmpdir(), "chj-log-missing-"));24
t.after(() => fs.rmSync(root, { recursive: true, force: true }));25
assert.equal(normalizeLimit(Number.MAX_SAFE_INTEGER), MAX_LIMIT);26
assert.equal((await new LogService(path.join(root, "missing.log")).readTail()).text, "");27
});SHA-256
83099441b516dc585e5dbebf22dc6c8fa3df77e539538f2b8673e6869e7bf137CH-J Proprietary Software License 1.14 · 소스는 CH-J Proprietary Software License 1.14에 따라 제공됩니다. 소스를 공개한다고 해서 라이선스 조항이 바뀌거나 추가 권리가 부여되지는 않습니다.
압축 파일 SHA-256
de757268dbc4f0226549f8b4f41f9b7e585c856ee97fa0d43b17a0e95c281449