Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

browser-bunyan

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-bunyan - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

lib/index.js.map

2

dist/browser-bunyan.min.js

@@ -1,1 +0,1 @@

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.bunyan={})}(this,function(e){"use strict";function r(e){return"string"==typeof e?h[e.toLowerCase()]:e}function t(e){if(void 0===e||null===e)return e;if(Array.isArray(e))return e.slice();if("object"===(void 0===e?"undefined":d(e))){var r={};return Object.keys(e).forEach(function(t){r[t]=e[t]}),r}return e}function s(e){return void 0===e?"undefined":null===e?"null":Array.isArray(e)?"[ "+e.map(function(e){return s(e)}).join(", ")+" ]":"object"===(void 0===e?"undefined":d(e))?JSON.stringify(e):"function"==typeof e?"[Function: "+e.name+"]":"boolean"==typeof e||"number"==typeof e?e:"'"+e.toString()+"'"}function i(e){if("string"!=typeof e){for(var r=new Array(arguments.length),t=0;t<arguments.length;t++)r[t]=s(arguments[t]);return r.join(" ")}for(var i=1,n=arguments,o=n.length,l=String(e).replace(/%[sdj%]/g,function(e){if("%%"===e)return"%";if(i>=o)return e;switch(e){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(e){return"[Circular]"}default:return e}}),a=n[i];i<o;a=n[++i])l+=" "+a;return l}function n(e,r){var t=e.split("\n");t[0]&&t[0].indexOf(b)>=0&&t.shift();var s=t[r],i=null;if(s){var n=/^\s*(at|.*@)\s*(.+)?$/.exec(s);i=Array.isArray(n)&&n[2]?n[2]:s}return i}function o(e,r){return r||(r=" "),r+e.split(/\r?\n/g).join("\n"+r)}function l(e,r){if(r){if(w[r])return;w[r]=!0}console.error(e+"\n")}function a(e){return w[e]}function c(){var e=[];return function(r,t){return t&&"object"===(void 0===t?"undefined":d(t))?-1!==e.indexOf(t)?"[Circular]":(e.push(t),t):t}}function u(e){return function(){var r=this,s=null,o=arguments,c=null;if(0===arguments.length)return this._level<=e;this._level>e||(c=function(c){var u=void 0;c[0]instanceof Error?(s={err:r.serializers&&r.serializers.err?r.serializers.err(c[0]):E.err(c[0])},u={err:!0},o=1===c.length?[s.err.message]:Array.prototype.slice.call(c,1)):"object"!==d(c[0])&&null!==c[0]||Array.isArray(c[0])?(s=null,o=Array.prototype.slice.call(c)):(s=c[0],o=1===c.length&&s.err&&s.err instanceof Error?[s.err.message]:Array.prototype.slice.call(c,1));var f=t(r.fields);f.level=e;var v=s?t(s):null;if(v&&(r.serializers&&r._applySerializers(v,u),Object.keys(v).forEach(function(e){f[e]=v[e]})),f.levelName=y[e],f.msg=o.length?i.apply(r,o):"",f.time||(f.time=new Date),r.src&&!f.src)try{throw new Error(b)}catch(e){var h=n(e.stack,2);h||a("src")||l("Unable to determine src line info","src"),f.src=h||""}return f.v=S,f}(o),this._emit(c))}}function f(e){var r=e.stack||e.toString();if(e.cause&&"function"==typeof e.cause){var t=e.cause();t&&(r+="\nCaused by: "+f(t))}return r}function v(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return new(Function.prototype.bind.apply(j,[null].concat(r)))}var h={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},y={};Object.keys(h).forEach(function(e){y[h[e]]=e});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},p=function(){function e(e,r){for(var t=0;t<r.length;t++){var s=r[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(r,t,s){return t&&e(r.prototype,t),s&&e(r,s),r}}(),g=function(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e},b="call-stack-error",w={},k=function(){function e(){m(this,e)}return p(e,[{key:"write",value:function(e){e.level<30?console.log(e):e.level<40?console.info(e):e.level<50?console.warn(e):console.error(e),e.err&&e.err.stack&&console.error(e.err.stack),e.obj&&console.log(e.obj)}}]),e}(),S=0,j=function(){function e(r,s,i){var n=this;if(m(this,e),!(this instanceof e))return new e(r,s);var o=void 0;if(void 0!==s&&(o=r,r=s,!(o instanceof e)))throw new TypeError("invalid Logger creation: do not pass a second arg");if(!r)throw new TypeError("options (object) is required");if(o){if(r.name)throw new TypeError("invalid options.name: child cannot set logger name")}else if(!r.name)throw new TypeError("options.name (string) is required");if(r.stream&&r.streams)throw new TypeError('cannot mix "streams" and "stream" options');if(r.streams&&!Array.isArray(r.streams))throw new TypeError("invalid options.streams: must be an array");if(r.serializers&&("object"!==d(r.serializers)||Array.isArray(r.serializers)))throw new TypeError("invalid options.serializers: must be an object");var l=void 0,a=void 0,c=void 0;if(o&&i){this._level=o._level,this.streams=o.streams,this.serializers=o.serializers,this.src=o.src,l=this.fields={};var u=Object.keys(o.fields);for(c=0;c<u.length;c++)a=u[c],l[a]=o.fields[a];var f=Object.keys(r);for(c=0;c<f.length;c++)a=f[c],l[a]=r[a]}else{if(o){for(this._level=o._level,this.streams=[],c=0;c<o.streams.length;c++){var v=t(o.streams[c]);this.streams.push(v)}this.serializers=t(o.serializers),this.src=o.src,this.fields=t(o.fields),r.level&&this.level(r.level)}else this._level=Number.POSITIVE_INFINITY,this.streams=[],this.serializers=null,this.src=!1,this.fields={};r.stream?this.addStream({type:"stream",stream:r.stream,level:r.level}):r.streams?r.streams.forEach(function(e){n.addStream(e,r.level)}):o&&r.level?this.level(r.level):o||this.addStream({type:"raw",stream:new k,level:r.level}),r.serializers&&this.addSerializers(r.serializers),r.src&&(this.src=!0),delete(l=t(r)).stream,delete l.level,delete l.streams,delete l.serializers,delete l.src,this.serializers&&this._applySerializers(l),Object.keys(l).forEach(function(e){n.fields[e]=l[e]})}}return p(e,[{key:"addStream",value:function(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;(e=t(e)).type="raw",e.level=r(e.level||s),e.level<this._level&&(this._level=e.level),this.streams.push(e),delete this.haveNonRawStreams}},{key:"addSerializers",value:function(e){var r=this;this.serializers||(this.serializers={}),Object.keys(e).forEach(function(t){var s=e[t];if("function"!=typeof s)throw new TypeError(i('invalid serializer for "%s" field: must be a function',t));r.serializers[t]=s})}},{key:"child",value:function(e,r){return new this.constructor(this,e||{},r)}},{key:"level",value:function(e){if(void 0===e)return this._level;for(var t=r(e),s=this.streams.length,i=0;i<s;i++)this.streams[i].level=t;this._level=t}},{key:"levels",value:function(e,t){if(void 0===e)return this.streams.map(function(e){return e.level});var s=void 0;if("number"==typeof e){if(void 0===(s=this.streams[e]))throw new Error("invalid stream index: "+e)}else{for(var n=this.streams.length,o=0;o<n;o++){var l=this.streams[o];if(l.name===e){s=l;break}}if(!s)throw new Error(i('no stream with name "%s"',e))}if(void 0===t)return s.level;var a=r(t);s.level=a,a<this._level&&(this._level=a)}},{key:"_applySerializers",value:function(e,r){var t=this;Object.keys(this.serializers).forEach(function(s){if(!(void 0===e[s]||r&&r[s]))try{e[s]=t.serializers[s](e[s])}catch(r){l(i('bunyan: ERROR: Exception thrown from the "%s" Bunyan serializer. This should never happen. This is a bugin that serializer function.\n%s',s,r.stack||r)),e[s]=i('(Error in Bunyan log "%s" serializer broke field. See stderr for details.)',s)}})}},{key:"_emit",value:function(e,r){var t=void 0;if(void 0===this.haveNonRawStreams)for(this.haveNonRawStreams=!1,t=0;t<this.streams.length;t++)if(!this.streams[t].raw){this.haveNonRawStreams=!0;break}var s=void 0;if(r||this.haveNonRawStreams)try{s=JSON.stringify(e,c())+"\n"}catch(r){var n=r.stack.split(/\n/g,2).join("\n");l('bunyan: ERROR: Exception in `JSON.stringify(rec)`. You can install the "safe-json-stringify" module to have Bunyan fallback to safer stringification. Record:\n'+o(i("%s\n%s",e,r.stack)),n),s=i("(Exception in JSON.stringify(rec): %j. See stderr for details.)\n",r.message)}if(r)return s;var a=e.level;for(t=0;t<this.streams.length;t++){var u=this.streams[t];u.level<=a&&u.stream.write(e)}return s}}]),e}();j.prototype.trace=u(10),j.prototype.debug=u(20),j.prototype.info=u(30),j.prototype.warn=u(40),j.prototype.error=u(50),j.prototype.fatal=u(60);var z,E={err:function(e){return e&&e.stack?{message:e.message,name:e.name,stack:f(e),code:e.code,signal:e.signal}:e}},A={levels:(z={},g(z,10,"color: DeepPink"),g(z,20,"color: GoldenRod"),g(z,30,"color: DarkTurquoise"),g(z,40,"color: Purple"),g(z,50,"color: Crimson"),g(z,60,"color: Black"),z),def:"color: DimGray",msg:"color: SteelBlue",src:"color: DimGray; font-style: italic; font-size: 0.9em"},O=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=r.logByLevel,s=void 0!==t&&t,i=r.css,n=void 0===i?A:i;m(this,e),this.logByLevel=s,this.css=n}return p(e,[{key:"write",value:function(e){var r=void 0,t=void 0,s=this.css.def,i=this.css.msg,n=this.css.src,o=e.childName?e.name+"/"+e.childName:e.name,l=y[e.level],a=(Array(6-l.length).join(" ")+l).toUpperCase();this.logByLevel?(10===e.level?l="debug":60===e.level&&(l="error"),t="function"==typeof console[l]?console[l]:console.log):t=console.log,r=e.level<20?this.css.levels[10]:e.level<30?this.css.levels[20]:e.level<40?this.css.levels[30]:e.level<50?this.css.levels[40]:e.level<60?this.css.levels[50]:this.css.levels[60];var c=function(e,r){return Array(r+1-(e+"").length).join("0")+e},u=[];u.push("[%s:%s:%s:%s] %c%s%c: %s: %c%s "+(e.src?"%c%s":"")),u.push(c(e.time.getHours(),2)),u.push(c(e.time.getMinutes(),2)),u.push(c(e.time.getSeconds(),2)),u.push(c(e.time.getMilliseconds(),4)),u.push(r),u.push(a),u.push(s),u.push(o),u.push(i),u.push(e.msg),e.src&&(u.push(n),u.push(e.src)),t.apply(console,u),e.err&&e.err.stack&&t.call(console,"%c%s,",r,e.err.stack),e.obj&&t.call(console,e.obj)}}],[{key:"getDefaultCss",value:function(){return A}}]),e}();e.TRACE=10,e.DEBUG=20,e.INFO=30,e.WARN=40,e.ERROR=50,e.FATAL=60,e.resolveLevel=r,e.levelFromName=h,e.nameFromLevel=y,e.stdSerializers=E,e.Logger=j,e.createLogger=v,e.safeCycles=c,e.ConsoleFormattedStream=O,e.ConsoleRawStream=k,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.bunyan={})}(this,function(e){"use strict";function r(e){return"string"==typeof e?h[e.toLowerCase()]:e}function t(e){if(void 0===e||null===e)return e;if(Array.isArray(e))return e.slice();if("object"===(void 0===e?"undefined":d(e))){var r={};return Object.keys(e).forEach(function(t){r[t]=e[t]}),r}return e}function s(e){return void 0===e?"undefined":null===e?"null":Array.isArray(e)?"[ "+e.map(function(e){return s(e)}).join(", ")+" ]":"object"===(void 0===e?"undefined":d(e))?JSON.stringify(e):"function"==typeof e?"[Function: "+e.name+"]":"boolean"==typeof e||"number"==typeof e?e:"'"+e.toString()+"'"}function i(e){if("string"!=typeof e){for(var r=new Array(arguments.length),t=0;t<arguments.length;t++)r[t]=s(arguments[t]);return r.join(" ")}for(var i=1,n=arguments,o=n.length,l=String(e).replace(/%[sdj%]/g,function(e){if("%%"===e)return"%";if(i>=o)return e;switch(e){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(e){return"[Circular]"}default:return e}}),a=n[i];i<o;a=n[++i])l+=" "+a;return l}function n(e,r){var t=e.split("\n");t[0]&&t[0].indexOf(g)>=0&&t.shift();var s=t[r],i=null;if(s){var n=/^\s*(at|.*@)\s*(.+)?$/.exec(s);i=Array.isArray(n)&&n[2]?n[2]:s}return i}function o(e,r){return r||(r=" "),r+e.split(/\r?\n/g).join("\n"+r)}function l(e,r){if(r){if(b[r])return;b[r]=!0}console.error(e+"\n")}function a(e){return b[e]}function c(){var e=[];return function(r,t){return t&&"object"===(void 0===t?"undefined":d(t))?-1!==e.indexOf(t)?"[Circular]":(e.push(t),t):t}}function u(e){return function(){var r=this,s=null,o=arguments,c=null;if(0===arguments.length)return this._level<=e;this._level>e||(c=function(c){var u=void 0;c[0]instanceof Error?(s={err:r.serializers&&r.serializers.err?r.serializers.err(c[0]):z.err(c[0])},u={err:!0},o=1===c.length?[s.err.message]:Array.prototype.slice.call(c,1)):"object"!==d(c[0])&&null!==c[0]||Array.isArray(c[0])?(s=null,o=Array.prototype.slice.call(c)):(s=c[0],o=1===c.length&&s.err&&s.err instanceof Error?[s.err.message]:Array.prototype.slice.call(c,1));var f=t(r.fields);f.level=e;var v=s?t(s):null;if(v&&(r.serializers&&r._applySerializers(v,u),Object.keys(v).forEach(function(e){f[e]=v[e]})),f.levelName=y[e],f.msg=o.length?i.apply(r,o):"",f.time||(f.time=new Date),r.src&&!f.src)try{throw new Error(g)}catch(e){var h=n(e.stack,2);h||a("src")||l("Unable to determine src line info","src"),f.src=h||""}return f.v=k,f}(o),this._emit(c))}}function f(e){var r=e.stack||e.toString();if(e.cause&&"function"==typeof e.cause){var t=e.cause();t&&(r+="\nCaused by: "+f(t))}return r}function v(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return new(Function.prototype.bind.apply(S,[null].concat(r)))}var h={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},y={};Object.keys(h).forEach(function(e){y[h[e]]=e});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},p=function(){function e(e,r){for(var t=0;t<r.length;t++){var s=r[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(r,t,s){return t&&e(r.prototype,t),s&&e(r,s),r}}(),g="call-stack-error",b={},w=function(){function e(){m(this,e)}return p(e,[{key:"write",value:function(e){e.level<30?console.log(e):e.level<40?console.info(e):e.level<50?console.warn(e):console.error(e),e.err&&e.err.stack&&console.error(e.err.stack),e.obj&&console.log(e.obj)}}]),e}(),k=1,S=function(){function e(r,s,i){var n=this;if(m(this,e),!(this instanceof e))return new e(r,s);var o=void 0;if(void 0!==s&&(o=r,r=s,!(o instanceof e)))throw new TypeError("invalid Logger creation: do not pass a second arg");if(!r)throw new TypeError("options (object) is required");if(o){if(r.name)throw new TypeError("invalid options.name: child cannot set logger name")}else if(!r.name)throw new TypeError("options.name (string) is required");if(r.stream&&r.streams)throw new TypeError('cannot mix "streams" and "stream" options');if(r.streams&&!Array.isArray(r.streams))throw new TypeError("invalid options.streams: must be an array");if(r.serializers&&("object"!==d(r.serializers)||Array.isArray(r.serializers)))throw new TypeError("invalid options.serializers: must be an object");var l=void 0,a=void 0,c=void 0;if(o&&i){this._level=o._level,this.streams=o.streams,this.serializers=o.serializers,this.src=o.src,l=this.fields={};var u=Object.keys(o.fields);for(c=0;c<u.length;c++)a=u[c],l[a]=o.fields[a];var f=Object.keys(r);for(c=0;c<f.length;c++)a=f[c],l[a]=r[a]}else{if(o){for(this._level=o._level,this.streams=[],c=0;c<o.streams.length;c++){var v=t(o.streams[c]);this.streams.push(v)}this.serializers=t(o.serializers),this.src=o.src,this.fields=t(o.fields),r.level&&this.level(r.level)}else this._level=Number.POSITIVE_INFINITY,this.streams=[],this.serializers=null,this.src=!1,this.fields={};r.stream?this.addStream({type:"stream",stream:r.stream,level:r.level}):r.streams?r.streams.forEach(function(e){n.addStream(e,r.level)}):o&&r.level?this.level(r.level):o||this.addStream({type:"raw",stream:new w,level:r.level}),r.serializers&&this.addSerializers(r.serializers),r.src&&(this.src=!0),delete(l=t(r)).stream,delete l.level,delete l.streams,delete l.serializers,delete l.src,this.serializers&&this._applySerializers(l),Object.keys(l).forEach(function(e){n.fields[e]=l[e]})}}return p(e,[{key:"addStream",value:function(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;(e=t(e)).type="raw",e.level=r(e.level||s),e.level<this._level&&(this._level=e.level),this.streams.push(e),delete this.haveNonRawStreams}},{key:"addSerializers",value:function(e){var r=this;this.serializers||(this.serializers={}),Object.keys(e).forEach(function(t){var s=e[t];if("function"!=typeof s)throw new TypeError(i('invalid serializer for "%s" field: must be a function',t));r.serializers[t]=s})}},{key:"child",value:function(e,r){return new this.constructor(this,e||{},r)}},{key:"level",value:function(e){if(void 0===e)return this._level;for(var t=r(e),s=this.streams.length,i=0;i<s;i++)this.streams[i].level=t;this._level=t}},{key:"levels",value:function(e,t){if(void 0===e)return this.streams.map(function(e){return e.level});var s=void 0;if("number"==typeof e){if(void 0===(s=this.streams[e]))throw new Error("invalid stream index: "+e)}else{for(var n=this.streams.length,o=0;o<n;o++){var l=this.streams[o];if(l.name===e){s=l;break}}if(!s)throw new Error(i('no stream with name "%s"',e))}if(void 0===t)return s.level;var a=r(t);s.level=a,a<this._level&&(this._level=a)}},{key:"_applySerializers",value:function(e,r){var t=this;Object.keys(this.serializers).forEach(function(s){if(!(void 0===e[s]||r&&r[s]))try{e[s]=t.serializers[s](e[s])}catch(r){l(i('bunyan: ERROR: Exception thrown from the "%s" Bunyan serializer. This should never happen. This is a bugin that serializer function.\n%s',s,r.stack||r)),e[s]=i('(Error in Bunyan log "%s" serializer broke field. See stderr for details.)',s)}})}},{key:"_emit",value:function(e,r){var t=void 0;if(void 0===this.haveNonRawStreams)for(this.haveNonRawStreams=!1,t=0;t<this.streams.length;t++)if(!this.streams[t].raw){this.haveNonRawStreams=!0;break}var s=void 0;if(r||this.haveNonRawStreams)try{s=JSON.stringify(e,c())+"\n"}catch(r){var n=r.stack.split(/\n/g,2).join("\n");l('bunyan: ERROR: Exception in `JSON.stringify(rec)`. You can install the "safe-json-stringify" module to have Bunyan fallback to safer stringification. Record:\n'+o(i("%s\n%s",e,r.stack)),n),s=i("(Exception in JSON.stringify(rec): %j. See stderr for details.)\n",r.message)}if(r)return s;var a=e.level;for(t=0;t<this.streams.length;t++){var u=this.streams[t];u.level<=a&&u.stream.write(e)}return s}}]),e}();S.prototype.trace=u(10),S.prototype.debug=u(20),S.prototype.info=u(30),S.prototype.warn=u(40),S.prototype.error=u(50),S.prototype.fatal=u(60);var z={err:function(e){return e&&e.stack?{message:e.message,name:e.name,stack:f(e),code:e.code,signal:e.signal}:e}},j={levels:{trace:"color: DeepPink",debug:"color: GoldenRod",info:"color: DarkTurquoise",warn:"color: Purple",error:"color: Crimson",fatal:"color: Black"},def:"color: DimGray",msg:"color: SteelBlue",src:"color: DimGray; font-style: italic; font-size: 0.9em"},E=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=r.logByLevel,s=void 0!==t&&t,i=r.css,n=void 0===i?j:i;m(this,e),this.logByLevel=s,this.css=n}return p(e,[{key:"write",value:function(e){var r=void 0,t=void 0,s=this.css.def,i=this.css.msg,n=this.css.src,o=e.childName?e.name+"/"+e.childName:e.name,l=y[e.level],a=(Array(6-l.length).join(" ")+l).toUpperCase();this.logByLevel?(10===e.level?l="debug":60===e.level&&(l="error"),t="function"==typeof console[l]?console[l]:console.log):t=console.log,r=e.level<20?this.css.levels.trace:e.level<30?this.css.levels.debug:e.level<40?this.css.levels.info:e.level<50?this.css.levels.warn:e.level<60?this.css.levels.error:this.css.levels.fatal;var c=function(e,r){return Array(r+1-(e+"").length).join("0")+e},u=[];u.push("[%s:%s:%s:%s] %c%s%c: %s: %c%s "+(e.src?"%c%s":"")),u.push(c(e.time.getHours(),2)),u.push(c(e.time.getMinutes(),2)),u.push(c(e.time.getSeconds(),2)),u.push(c(e.time.getMilliseconds(),4)),u.push(r),u.push(a),u.push(s),u.push(o),u.push(i),u.push(e.msg),e.src&&(u.push(n),u.push(e.src)),t.apply(console,u),e.err&&e.err.stack&&t.call(console,"%c%s,",r,e.err.stack),e.obj&&t.call(console,e.obj)}}],[{key:"getDefaultCss",value:function(){return j}}]),e}();e.TRACE=10,e.DEBUG=20,e.INFO=30,e.WARN=40,e.ERROR=50,e.FATAL=60,e.resolveLevel=r,e.levelFromName=h,e.nameFromLevel=y,e.stdSerializers=z,e.Logger=S,e.createLogger=v,e.safeCycles=c,e.ConsoleFormattedStream=E,e.ConsoleRawStream=w,Object.defineProperty(e,"__esModule",{value:!0})});

@@ -10,12 +10,15 @@ 'use strict';

var _levels;
var _levels = require('./levels');
var _levels2 = require('./levels');
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var DEFAULT_CSS = {
levels: (_levels = {}, _defineProperty(_levels, _levels2.TRACE, 'color: DeepPink'), _defineProperty(_levels, _levels2.DEBUG, 'color: GoldenRod'), _defineProperty(_levels, _levels2.INFO, 'color: DarkTurquoise'), _defineProperty(_levels, _levels2.WARN, 'color: Purple'), _defineProperty(_levels, _levels2.ERROR, 'color: Crimson'), _defineProperty(_levels, _levels2.FATAL, 'color: Black'), _levels),
levels: {
trace: 'color: DeepPink',
debug: 'color: GoldenRod',
info: 'color: DarkTurquoise',
warn: 'color: Purple',
error: 'color: Crimson',
fatal: 'color: Black'
},
def: 'color: DimGray',

@@ -52,9 +55,9 @@ msg: 'color: SteelBlue',

//get level name and pad start with spacs
var levelName = _levels2.nameFromLevel[rec.level];
var levelName = _levels.nameFromLevel[rec.level];
var formattedLevelName = (Array(6 - levelName.length).join(' ') + levelName).toUpperCase();
if (this.logByLevel) {
if (rec.level === _levels2.TRACE) {
if (rec.level === _levels.TRACE) {
levelName = 'debug';
} else if (rec.level === _levels2.FATAL) {
} else if (rec.level === _levels.FATAL) {
levelName = 'error';

@@ -67,14 +70,14 @@ }

if (rec.level < _levels2.DEBUG) {
levelCss = this.css.levels[_levels2.TRACE];
} else if (rec.level < _levels2.INFO) {
levelCss = this.css.levels[_levels2.DEBUG];
} else if (rec.level < _levels2.WARN) {
levelCss = this.css.levels[_levels2.INFO];
} else if (rec.level < _levels2.ERROR) {
levelCss = this.css.levels[_levels2.WARN];
} else if (rec.level < _levels2.FATAL) {
levelCss = this.css.levels[_levels2.ERROR];
if (rec.level < _levels.DEBUG) {
levelCss = this.css.levels.trace;
} else if (rec.level < _levels.INFO) {
levelCss = this.css.levels.debug;
} else if (rec.level < _levels.WARN) {
levelCss = this.css.levels.info;
} else if (rec.level < _levels.ERROR) {
levelCss = this.css.levels.warn;
} else if (rec.level < _levels.FATAL) {
levelCss = this.css.levels.error;
} else {
levelCss = this.css.levels[_levels2.FATAL];
levelCss = this.css.levels.fatal;
}

@@ -81,0 +84,0 @@

@@ -22,3 +22,3 @@ 'use strict';

var LOG_VERSION = 0;
var LOG_VERSION = 1;

@@ -25,0 +25,0 @@ //---- Logger class

{
"name": "browser-bunyan",
"version": "1.2.0",
"version": "1.2.1",
"description": "Bunyan logging specifically for the browser",

@@ -31,4 +31,2 @@ "author": "Phil Mander <philip.mander@gmail.com>",

"babel-plugin-module-resolver": "^2.7.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-env": "^1.5.2",

@@ -35,0 +33,0 @@ "babel-tap": "^5.0.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc