@browser-bunyan/console-formatted-stream
Advanced tools
Comparing version 1.6.0 to 1.6.2
@@ -1,2 +0,2 @@ | ||
var h=10,v=20,p=30,f=40,g=50,m=60,s={trace:h,debug:v,info:p,warn:f,error:g,fatal:m},d={};Object.keys(s).forEach(function(e){d[s[e]]=e});var o={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(e){void 0===e&&(e={});var s=e.logByLevel;void 0===s&&(s=!1);var l=e.css;void 0===l&&(l=o),this.logByLevel=s,this.css=l};e.prototype.write=function(e){var s,l,o=this.css.def,r=this.css.msg,c=this.css.src,t=e.childName?e.name+"/"+e.childName:e.name,i=d[e.level],n=(Array(6-i.length).join(" ")+i).toUpperCase();l=this.logByLevel?(e.level===h?i="debug":e.level===m&&(i="error"),"function"==typeof console[i]?console[i]:console.log):console.log,s=e.level<v?this.css.levels.trace:e.level<p?this.css.levels.debug:e.level<f?this.css.levels.info:e.level<g?this.css.levels.warn:e.level<m?this.css.levels.error:this.css.levels.fatal;var a=function(e,s){return Array(s+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(a(e.time.getHours(),2)),u.push(a(e.time.getMinutes(),2)),u.push(a(e.time.getSeconds(),2)),u.push(a(e.time.getMilliseconds(),4)),u.push(s),u.push(n),u.push(o),u.push(t),u.push(r),u.push(e.msg),e.src&&(u.push(c),u.push(e.src)),l.apply(console,u),e.err&&e.err.stack&&l.call(console,"%c%s,",s,e.err.stack),e.obj&&l.call(console,e.obj)},e.getDefaultCss=function(){return o},exports.ConsoleFormattedStream=e; | ||
var h=10,p=20,v=30,f=40,g=50,m=60,s={trace:h,debug:p,info:v,warn:f,error:g,fatal:m},d={};Object.keys(s).forEach(function(e){d[s[e]]=e});var o={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(e){void 0===e&&(e={});var s=e.logByLevel;void 0===s&&(s=!1);var l=e.css;void 0===l&&(l=o),this.logByLevel=s,this.css=l};e.prototype.write=function(e){var s,l,o=this.css.def,r=this.css.msg,t=this.css.src,c=e.childName?e.name+"/"+e.childName:e.name,i=d[e.level],n=(Array(6-i.length).join(" ")+i).toUpperCase();l=this.logByLevel?(e.level===h?i="debug":e.level===m&&(i="error"),"function"==typeof console[i]?console[i]:console.log):console.log,s=e.level<p?this.css.levels.trace:e.level<v?this.css.levels.debug:e.level<f?this.css.levels.info:e.level<g?this.css.levels.warn:e.level<m?this.css.levels.error:this.css.levels.fatal;var a=function(e,s){return Array(s+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(a(e.time.getHours(),2)),u.push(a(e.time.getMinutes(),2)),u.push(a(e.time.getSeconds(),2)),u.push(a(e.time.getMilliseconds(),4)),u.push(s),u.push(n),u.push(o),u.push(c),u.push(r),u.push(e.msg),e.src&&(u.push(t),u.push(e.src)),e.obj&&(u.push("\n"),u.push(e.obj)),e.err&&e.err.stack&&(u.push("\n"),u.push(e.err.stack)),l.apply(console,u)},e.getDefaultCss=function(){return o},exports.ConsoleFormattedStream=e; | ||
//# sourceMappingURL=index.js.map |
@@ -89,9 +89,11 @@ var TRACE = 10; | ||
} | ||
consoleMethod.apply(console, logArgs); | ||
if (rec.obj) { | ||
logArgs.push('\n'); | ||
logArgs.push(rec.obj); | ||
} | ||
if (rec.err && rec.err.stack) { | ||
consoleMethod.call(console, '%c%s,', levelCss, rec.err.stack); | ||
logArgs.push('\n'); | ||
logArgs.push(rec.err.stack); | ||
} | ||
if (rec.obj) { | ||
consoleMethod.call(console, rec.obj); | ||
} | ||
consoleMethod.apply(console, logArgs); | ||
}; | ||
@@ -98,0 +100,0 @@ ConsoleFormattedStream.getDefaultCss = function getDefaultCss () { |
@@ -1,2 +0,2 @@ | ||
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports):"function"==typeof define&&define.amd?define(["exports"],s):s(e.consoleFormattedStream={})}(this,function(e){var s={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},h={};Object.keys(s).forEach(function(e){h[s[e]]=e});var l={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"},o=function(e){void 0===e&&(e={});var s=e.logByLevel;void 0===s&&(s=!1);var o=e.css;void 0===o&&(o=l),this.logByLevel=s,this.css=o};o.prototype.write=function(e){var s,o,l=this.css.def,r=this.css.msg,t=this.css.src,c=e.childName?e.name+"/"+e.childName:e.name,n=h[e.level],i=(Array(6-n.length).join(" ")+n).toUpperCase();o=this.logByLevel?(10===e.level?n="debug":60===e.level&&(n="error"),"function"==typeof console[n]?console[n]:console.log):console.log,s=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 a=function(e,s){return Array(s+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(a(e.time.getHours(),2)),u.push(a(e.time.getMinutes(),2)),u.push(a(e.time.getSeconds(),2)),u.push(a(e.time.getMilliseconds(),4)),u.push(s),u.push(i),u.push(l),u.push(c),u.push(r),u.push(e.msg),e.src&&(u.push(t),u.push(e.src)),o.apply(console,u),e.err&&e.err.stack&&o.call(console,"%c%s,",s,e.err.stack),e.obj&&o.call(console,e.obj)},o.getDefaultCss=function(){return l},e.ConsoleFormattedStream=o}); | ||
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports):"function"==typeof define&&define.amd?define(["exports"],s):s(e.consoleFormattedStream={})}(this,function(e){var s={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},h={};Object.keys(s).forEach(function(e){h[s[e]]=e});var l={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"},o=function(e){void 0===e&&(e={});var s=e.logByLevel;void 0===s&&(s=!1);var o=e.css;void 0===o&&(o=l),this.logByLevel=s,this.css=o};o.prototype.write=function(e){var s,o,l=this.css.def,r=this.css.msg,t=this.css.src,c=e.childName?e.name+"/"+e.childName:e.name,n=h[e.level],i=(Array(6-n.length).join(" ")+n).toUpperCase();o=this.logByLevel?(10===e.level?n="debug":60===e.level&&(n="error"),"function"==typeof console[n]?console[n]:console.log):console.log,s=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 u=function(e,s){return Array(s+1-(e+"").length).join("0")+e},a=[];a.push("[%s:%s:%s:%s] %c%s%c: %s: %c%s "+(e.src?"%c%s":"")),a.push(u(e.time.getHours(),2)),a.push(u(e.time.getMinutes(),2)),a.push(u(e.time.getSeconds(),2)),a.push(u(e.time.getMilliseconds(),4)),a.push(s),a.push(i),a.push(l),a.push(c),a.push(r),a.push(e.msg),e.src&&(a.push(t),a.push(e.src)),e.obj&&(a.push("\n"),a.push(e.obj)),e.err&&e.err.stack&&(a.push("\n"),a.push(e.err.stack)),o.apply(console,a)},o.getDefaultCss=function(){return l},e.ConsoleFormattedStream=o}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "@browser-bunyan/console-formatted-stream", | ||
"version": "1.6.0", | ||
"version": "1.6.2", | ||
"description": "Bunyan stream for outputting nicely formatted records to the browser console", | ||
@@ -41,3 +41,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "ad020a76f6708f55a36021e4b4a43bccaf28c1ea" | ||
"gitHead": "7df6c318eada1fe832bf4fcdeb864a086f0668ef" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9752
127