UNPKG

@actorize/core

Version:

Actorize helps building scalable js apps with a messaging system

19 lines 583 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const createLogPlugin = (opts) => { const { logger = console.debug, filter, } = opts || {}; return { onMessage: (msg) => { if (filter) { const shouldLog = filter(msg); if (!shouldLog) { return msg; } } logger(`[ACTORIZE] (${msg.sender}) => (${msg.recipient})`, msg.payload); return msg; }, }; }; exports.default = createLogPlugin; //# sourceMappingURL=log.js.map