Files
OmniRoute/src/sse/utils/logger.ts
Diego Rodrigues de Sa e Souza 0adae00c7b Release v3.8.42 (#5459)
Release v3.8.42 — full CHANGELOG in CHANGELOG.md.

CI: 103 checks green incl. CodeQL (all languages), Semgrep, all 8 unit shards,
coverage, Node 24 compat, and integration tests. Full unit suite validated
locally: 19437 pass / 0 fail. The 3 red checks are advisory and do not gate
main (no required status checks): SonarCloud/SonarQube new-code coverage gate,
and PR Test Policy (test-masking detector flagging the legitimate dead-Phind
provider removal in #5530 — reviewed, correct).

Includes cycle-close reconciliation + repair of inherited base-red tests from
#5480/#5527/#5427/#5521 that the PR->release fast-path did not exercise.
2026-06-30 06:54:29 -03:00

38 lines
1.2 KiB
TypeScript

/**
* SSE Logger — Thin wrapper around the shared Pino logger
* for backward compatibility with existing SSE code.
*
* Migrated from direct console logging to structured Pino logging.
*/
import { createLogger } from "@/shared/utils/logger";
const log = createLogger("sse");
export function debug(tag: string, message: string, data?: unknown) {
log.debug({ tag, ...spreadData(data) }, message);
}
export function info(tag: string, message: string, data?: unknown) {
log.info({ tag, ...spreadData(data) }, message);
}
export function warn(tag: string, message: string, data?: unknown) {
log.warn({ tag, ...spreadData(data) }, message);
}
export function error(tag: string, message: string, data?: unknown) {
log.error({ tag, ...spreadData(data) }, message);
}
export function request(method: string, path: string, extra?: unknown) {
log.info({ tag: "HTTP", method, path, ...spreadData(extra) }, `📥 ${method} ${path}`);
}
// Helper to spread data into structured fields
function spreadData(data: unknown): Record<string, unknown> {
if (!data) return {};
if (typeof data === "string") return { detail: data };
if (typeof data === "object") return data as Record<string, unknown>;
return { detail: String(data) };
}