feat: log auto-reply body and stats for web provider
parent
2aac606979
commit
3aedef4126
|
|
@ -298,6 +298,7 @@ export async function monitorWebProvider(
|
||||||
: new Date().toISOString();
|
: new Date().toISOString();
|
||||||
console.log(`\n[${ts}] ${msg.from} -> ${msg.to}: ${msg.body}`);
|
console.log(`\n[${ts}] ${msg.from} -> ${msg.to}: ${msg.body}`);
|
||||||
|
|
||||||
|
const replyStarted = Date.now();
|
||||||
const replyText = await replyResolver(
|
const replyText = await replyResolver(
|
||||||
{
|
{
|
||||||
Body: msg.body,
|
Body: msg.body,
|
||||||
|
|
@ -312,8 +313,15 @@ export async function monitorWebProvider(
|
||||||
if (!replyText) return;
|
if (!replyText) return;
|
||||||
try {
|
try {
|
||||||
await msg.reply(replyText);
|
await msg.reply(replyText);
|
||||||
|
const durationMs = Date.now() - replyStarted;
|
||||||
if (isVerbose()) {
|
if (isVerbose()) {
|
||||||
console.log(success(`↩️ Auto-replied to ${msg.from} (web)`));
|
console.log(
|
||||||
|
success(
|
||||||
|
`↩️ Auto-replied to ${msg.from} (web, ${replyText.length} chars, ${durationMs}ms)`,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.log(`↩️ ${replyText}`);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(
|
console.error(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue