mirror of
https://github.com/morluto/rea
synced 2026-10-26 06:16:17 -04:00
16 lines
521 B
TypeScript
16 lines
521 B
TypeScript
import pino, { type Logger } from "pino";
|
|
import type { LogLevel } from "./config/processStart.js";
|
|
|
|
/** Create a JSON logger on stderr so protocol and CLI result stdout stay valid. */
|
|
export const createLogger = (mode: "mcp" | "cli", level: LogLevel): Logger =>
|
|
pino(
|
|
{
|
|
level,
|
|
base: { application: "rea", mode },
|
|
},
|
|
pino.destination({ dest: 2, sync: false }),
|
|
);
|
|
|
|
/** Logger used by embedders that have not opted into process output. */
|
|
export const silentLogger = pino({ level: "silent" });
|