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

@@ -1,7 +1,7 @@
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { isVerbose, logVerbose } from "./globals.js";
import { logVerbose, shouldLogVerbose } from "./globals.js";
export async function ensureDir(dir: string) {
await fs.promises.mkdir(dir, { recursive: true });
@@ -79,7 +79,7 @@ export function jidToE164(jid: string): string | null {
const phone = JSON.parse(data);
if (phone) return `+${phone}`;
} catch {
if (isVerbose()) {
if (shouldLogVerbose()) {
logVerbose(
`LID mapping not found for ${lid}; skipping inbound message`,
);