mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 19:00:38 +09:00
24 lines
450 B
TypeScript
24 lines
450 B
TypeScript
|
|
import pc from "picocolors";
|
||
|
|
|
||
|
|
export function printOpenClawGatewayStreamEvent(raw: string, debug: boolean): void {
|
||
|
|
const line = raw.trim();
|
||
|
|
if (!line) return;
|
||
|
|
|
||
|
|
if (!debug) {
|
||
|
|
console.log(line);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (line.startsWith("[openclaw-gateway:event]")) {
|
||
|
|
console.log(pc.cyan(line));
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (line.startsWith("[openclaw-gateway]")) {
|
||
|
|
console.log(pc.blue(line));
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
console.log(pc.gray(line));
|
||
|
|
}
|