UNPKG

atriusmaps-node-sdk

Version:

This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information

2 lines (1 loc) 1.01 kB
const e={black:"",red:"",green:"",yellow:"",blue:"",magenta:"",cyan:"",white:""};function o(r,n){const t=function(o,r={}){let n=o+": ",t=null;if(r.color)if(r.isBrowser)n="%c"+n,t=`color: ${r.color}`;else{const o=e[r.color];o&&(n=o+n)}function c(e){return function(){if(void 0===r.enabled||r.enabled||e===console.error){let o=Array.from(arguments);t&&o.unshift(t),o.unshift(n),r.truncateObjects&&e!==console.error&&(o=o.map((e=>{return"object"==typeof e?(o=JSON.stringify(e),n=parseInt(r.truncateObjects)||100,o&&o.length>n?o.substring(0,n)+"...":o):e;var o,n})));const c=!r.logFilter||((e,o)=>"string"==typeof o?e[0].includes(o):o.test(e[0]))(o,r.logFilter);(c||e===console.error)&&e.apply(console,o)}}}const l=c(r.trace?console.trace:console.log);return l.info=l,l.warn=c(console.warn),l.detailed=c(console.debug),l.error=c(console.error),l.setEnabled=e=>{r.enabled=e},l}(r,n);return t.sublog=(e,t)=>o(r+"."+e,Object.assign(Object.create(n),t)),t}export{o as initLog};