openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
28 lines (27 loc) • 903 B
JavaScript
import { t as createDedupeCache } from "./dedupe-DxT0h2gR.mjs";
//#region src/channels/logging.ts
const inboundDropWarnings = createDedupeCache({
ttlMs: 0,
maxSize: 512
});
function logInboundDrop(e) {
if (e.onceKey !== void 0 && inboundDropWarnings.check(JSON.stringify([
e.channel,
e.reason,
e.onceKey
]))) return;
const t = e.target ? ` target=${e.target}` : "";
const n = e.hint ? `. ${e.hint}` : "";
e.log(`${e.channel}: drop ${e.reason}${t}${n}`);
}
function logTypingFailure(e) {
const t = e.target ? ` target=${e.target}` : "";
const n = e.action ? ` action=${e.action}` : "";
e.log(`${e.channel} typing${n} failed${t}: ${String(e.error)}`);
}
function logAckFailure(e) {
const t = e.target ? ` target=${e.target}` : "";
e.log(`${e.channel} ack cleanup failed${t}: ${String(e.error)}`);
}
//#endregion
export { logInboundDrop as n, logTypingFailure as r, logAckFailure as t };