fix: align console logs in multi-provider mode
Suppress individual provider startup messages when running in multi-provider mode to avoid duplicate/conflicting console output. The multi-relay orchestrator provides unified startup messaging. Changes: - Add suppressStartMessage to WebMonitorTuning type - Update monitorWebProvider to suppress startup message when flag set - Update Telegram monitor to suppress initial "Starting..." message - Pass suppressStartMessage: true from multi-relay to both providers Console output before: 📡 Starting 2 provider(s): web, telegram 📡 Starting Telegram relay... 📡 Listening for personal WhatsApp Web inbound messages. Leave this running; Ctrl+C to stop. ✅ All 2 provider(s) active. Listening for messages... (Ctrl+C to stop) Console output after: 📡 Starting 2 provider(s): web, telegram ✅ All 2 provider(s) active. Listening for messages... (Ctrl+C to stop)
This commit is contained in:
parent
15a4631a97
commit
08bede3a0b
@ -59,7 +59,7 @@ export async function runMultiProviderRelay(
|
||||
undefined,
|
||||
runtime,
|
||||
signal,
|
||||
opts.webTuning,
|
||||
{ ...opts.webTuning, suppressStartMessage: true },
|
||||
);
|
||||
} else if (provider === "twilio") {
|
||||
const { monitorTwilio } = await import("../twilio/monitor.js");
|
||||
|
||||
@ -213,7 +213,9 @@ export async function monitorTelegramProvider(
|
||||
verbose,
|
||||
};
|
||||
|
||||
runtime.log(info("📡 Starting Telegram relay..."));
|
||||
if (!suppressStartMessage) {
|
||||
runtime.log(info("📡 Starting Telegram relay..."));
|
||||
}
|
||||
|
||||
// Create and initialize provider
|
||||
const provider = await createInitializedProvider("telegram", providerConfig);
|
||||
|
||||
@ -66,6 +66,7 @@ export type WebMonitorTuning = {
|
||||
replyHeartbeatMinutes?: number;
|
||||
replyHeartbeatNow?: boolean;
|
||||
sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
||||
suppressStartMessage?: boolean;
|
||||
};
|
||||
|
||||
const formatDuration = (ms: number) =>
|
||||
@ -1246,10 +1247,12 @@ export async function monitorWebProvider(
|
||||
}
|
||||
}
|
||||
|
||||
logInfo(
|
||||
"📡 Listening for personal WhatsApp Web inbound messages. Leave this running; Ctrl+C to stop.",
|
||||
runtime,
|
||||
);
|
||||
if (!tuning.suppressStartMessage) {
|
||||
logInfo(
|
||||
"📡 Listening for personal WhatsApp Web inbound messages.",
|
||||
runtime,
|
||||
);
|
||||
}
|
||||
|
||||
if (!keepAlive) {
|
||||
await closeListener();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user