@holz/log-collector
Version:
Send all logs to a central collector
2 lines (1 loc) • 402 B
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=()=>!0,s=({processor:t,condition:o=n})=>{e[c]={processor:t,condition:o}},r=()=>{delete e[c]},e=globalThis,c=Symbol.for("@holz/log-collector"),a=t=>o=>{const l=e[c];l!=null&&l.condition(o)?l.processor(o):t.fallback(o)};exports.createLogCollector=a;exports.setGlobalLogCollector=s;exports.unsetGlobalLogCollector=r;