UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

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