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

@@ -1,5 +1,6 @@
import { firstDefined, isSenderIdAllowed, mergeAllowFromSources } from "../channels/allow-from.js";
import type { AllowlistMatch } from "../channels/allowlist-match.js";
import { createSubsystemLogger } from "../logging/subsystem.js";
export type NormalizedAllowFrom = {
entries: string[];
@@ -11,6 +12,7 @@ export type NormalizedAllowFrom = {
export type AllowFromMatch = AllowlistMatch<"wildcard" | "id">;
const warnedInvalidEntries = new Set<string>();
const log = createSubsystemLogger("telegram/bot-access");
function warnInvalidAllowFromEntries(entries: string[]) {
if (process.env.VITEST || process.env.NODE_ENV === "test") {
@@ -21,9 +23,9 @@ function warnInvalidAllowFromEntries(entries: string[]) {
continue;
}
warnedInvalidEntries.add(entry);
console.warn(
log.warn(
[
"[telegram] Invalid allowFrom entry:",
"Invalid allowFrom entry:",
JSON.stringify(entry),
"- allowFrom/groupAllowFrom authorization requires numeric Telegram sender IDs only.",
'If you had "@username" entries, re-run onboarding (it resolves @username to IDs) or replace them manually.',