fix(logging): decouple file logs from console verbose

This commit is contained in:
Peter Steinberger
2026-01-03 12:32:14 +00:00
parent e52bdaa2a2
commit bb54e60179
18 changed files with 105 additions and 67 deletions

View File

@@ -65,7 +65,6 @@ let rawConsole: {
} | null = null;
function normalizeLevel(level?: string): Level {
if (isVerbose()) return "trace";
const candidate = level ?? "info";
return ALLOWED_LEVELS.includes(candidate as Level)
? (candidate as Level)
@@ -112,6 +111,12 @@ function levelToMinLevel(level: Level): number {
return map[level];
}
export function isFileLogLevelEnabled(level: LogLevel): boolean {
const settings = cachedSettings ?? resolveSettings();
if (!cachedSettings) cachedSettings = settings;
return levelToMinLevel(level) <= levelToMinLevel(settings.level);
}
function normalizeConsoleLevel(level?: string): Level {
if (isVerbose()) return "debug";
const candidate = level ?? "info";