refactor(coding-agent/cli): switched auth-broker serve to dedicated logger transport setter

- Updated the auth-broker CLI to import the transport setter from the logger module.
- Replaced the logger.setTransports call in runServe with the dedicated setTransports helper.
This commit is contained in:
can1357
2026-05-28 00:51:35 +02:00
parent 6491fff8f6
commit 3d5f0d8868
@@ -34,6 +34,7 @@ import {
startAuthBroker,
} from "@oh-my-pi/pi-ai";
import { $which, APP_NAME, getAgentDbPath, getConfigRootDir, isEnoent, logger, VERSION } from "@oh-my-pi/pi-utils";
import { setTransports as setLoggerTransports } from "@oh-my-pi/pi-utils/logger";
import { $ } from "bun";
import chalk from "chalk";
import { resolveAuthBrokerConfig } from "../session/auth-broker-config";
@@ -124,7 +125,7 @@ async function runServe(flags: AuthBrokerCommandArgs["flags"]): Promise<void> {
// The broker is a long-running headless service: route structured logs to
// stdout so a process supervisor (pm2, journald, k8s) captures them, and
// skip the rotating ~/.omp/logs/ file the TUI default would have used.
logger.setTransports({ console: true, file: false });
setLoggerTransports({ console: true, file: false });
const bind = flags.bind ?? DEFAULT_AUTH_BROKER_BIND;
const token = await ensureToken();