fix(logging): honor silent console level

This commit is contained in:
Peter Steinberger
2026-01-12 18:45:55 +00:00
parent b1c3e38df0
commit 45232137a2
2 changed files with 5 additions and 0 deletions

View File

@@ -116,6 +116,7 @@ function levelToMinLevel(level: Level): number {
export function isFileLogLevelEnabled(level: LogLevel): boolean {
const settings = cachedSettings ?? resolveSettings();
if (!cachedSettings) cachedSettings = settings;
if (settings.level === "silent") return false;
return levelToMinLevel(level) <= levelToMinLevel(settings.level);
}
@@ -389,6 +390,7 @@ type SubsystemLogger = {
};
function shouldLogToConsole(level: Level, settings: ConsoleSettings): boolean {
if (settings.level === "silent") return false;
const current = levelToMinLevel(level);
const min = levelToMinLevel(settings.level);
return current <= min;