@expofp/floorplan
Version:
Interactive floor plan library for expos and events
2 lines (1 loc) • 581 B
JavaScript
import r from"debug";class c{messages=[];log(...e){this.push("DEBUG",e),r("efp:floorplan:debug")(...e)}error(...e){this.push("ERROR",e),p(console.error,e)}warn(...e){this.push("WARN",e),p(console.warn,e)}info(...e){this.push("INFO",e),r("efp:floorplan:info")(...e)}push(e,o){const i=o.map(t=>{if(typeof t=="object")try{return JSON.stringify(t)}catch(h){return h.message}return t}),a=e+" "+new Date().toISOString()+" "+i.join("; ");this.messages.push(a);const n=1e3;this.messages.length>n&&this.messages.splice(0,n/2)}}function p(s,e){try{s.apply(s,e)}catch{}}export default new c;