refactor(logging): migrate non-agent internal console calls to subsystem logger (#22964)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: b4a5b12422
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
Gustavo Madeira Santana
2026-02-21 17:44:00 -05:00
committed by GitHub
parent 4ef4aa3c10
commit 2f46308d5a
14 changed files with 102 additions and 29 deletions

View File

@@ -86,6 +86,7 @@ const THREAD_NOT_FOUND_RE = /400:\s*Bad Request:\s*message thread not found/i;
const MESSAGE_NOT_MODIFIED_RE =
/400:\s*Bad Request:\s*message is not modified|MESSAGE_NOT_MODIFIED/i;
const CHAT_NOT_FOUND_RE = /400: Bad Request: chat not found/i;
const sendLogger = createSubsystemLogger("telegram/send");
const diagLogger = createSubsystemLogger("telegram/diagnostic");
function createTelegramHttpLogger(cfg: ReturnType<typeof loadConfig>) {
@@ -272,7 +273,7 @@ async function withTelegramHtmlParseFallback<T>(params: {
throw err;
}
if (params.verbose) {
console.warn(
sendLogger.warn(
`telegram ${params.label} failed with HTML parse error, retrying as plain text: ${formatErrorMessage(
err,
)}`,
@@ -378,7 +379,7 @@ async function withTelegramThreadFallback<T>(
throw err;
}
if (verbose) {
console.warn(
sendLogger.warn(
`telegram ${label} failed with message_thread_id, retrying without thread: ${formatErrorMessage(err)}`,
);
}