fix(logs): use local date for log filenames and expand export redaction (#131)

This commit is contained in:
2026-06-27 21:08:11 -07:00
committed by GitHub
parent 5326ad32f5
commit 36f94151b8
12 changed files with 946 additions and 27 deletions
+4 -3
View File
@@ -2,9 +2,10 @@ import test from 'node:test';
import assert from 'node:assert/strict';
import path from 'node:path';
import { resolveDefaultLogFilePath, setLogRotation } from './logger';
import { localDateKey } from './shared/log-files';
test('resolveDefaultLogFilePath uses APPDATA on windows', () => {
const today = new Date().toISOString().slice(0, 10);
const today = localDateKey(new Date());
const resolved = resolveDefaultLogFilePath({
platform: 'win32',
homeDir: 'C:\\Users\\tester',
@@ -20,7 +21,7 @@ test('resolveDefaultLogFilePath uses APPDATA on windows', () => {
});
test('resolveDefaultLogFilePath uses .config on linux', () => {
const today = new Date().toISOString().slice(0, 10);
const today = localDateKey(new Date());
const resolved = resolveDefaultLogFilePath({
platform: 'linux',
homeDir: '/home/tester',
@@ -34,7 +35,7 @@ test('resolveDefaultLogFilePath uses .config on linux', () => {
test('setLogRotation accepts numeric retention days', () => {
const previous = process.env.SUBMINER_LOG_ROTATION;
const today = new Date().toISOString().slice(0, 10);
const today = localDateKey(new Date());
setLogRotation(14);
try {
const resolved = resolveDefaultLogFilePath({