fancy-node-logger
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -1,1 +0,1 @@ | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault"),_slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")),_classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),Type=require("./Type"),chalk=require("chalk"),FancyNodeLogger=function e(){var l=this;(0,_classCallCheck2.default)(this,e),(0,_defineProperty2.default)(this,"parseMessages",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];switch(null==t?void 0:t.length){case 1:return[t[0]];case 2:return[t[0],null,t[1]];case 3:return[t[0],t[1],t[2]];default:return[]}}),(0,_defineProperty2.default)(this,"getDefaultSeverityStyle",function(e){switch(e){case Type.VERBOSE:return["bgWhite","black"];case Type.INFO:return["bgBlueBright","black"];case Type.SUCCESS:return["bgGreenBright","black"];case Type.WARNING:return["bgYellowBright","black"];case Type.ERROR:return["bgRedBright","black"];default:return["bgWhite","black"]}}),(0,_defineProperty2.default)(this,"getDefaultTitleStyle",function(e){switch(e){case Type.VERBOSE:return["white"];case Type.INFO:return["blueBright"];case Type.SUCCESS:return["greenBright"];case Type.WARNING:return["yellowBright"];case Type.ERROR:return["redBright"];default:return["white"]}}),(0,_defineProperty2.default)(this,"formatText",function(e,t){if(!e)return"";if(!t||(null==t?void 0:t.length)<1)return e;var r=chalk;return null!=t&&t.forEach(function(e){return r=null===r||void 0===r?void 0:r[e]}),r?r("",e,""):e}),(0,_defineProperty2.default)(this,"print",function(e,t,r,n,a,u){t=l.formatText(e,t),t=t?"".concat(t," "):"",r=l.formatText(r,n),n=r?"".concat(r," "):"",u=l.formatText(a,u),u=u?"".concat(r?"\n":"").concat(u,"\n"):"";console.log("".concat(t).concat(n).concat(u))}),(0,_defineProperty2.default)(this,"output",function(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var a=l.parseMessages.apply(l,r),u=(0,_slicedToArray2.default)(a,3),o=u[0],a=u[1],u=u[2];l.print(o,l.getDefaultSeverityStyle(e),a,l.getDefaultTitleStyle(e),u)}),(0,_defineProperty2.default)(this,"note",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.output.apply(l,[Type.VERBOSE,"NOTE"].concat(t))}),(0,_defineProperty2.default)(this,"verbose",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.output.apply(l,[Type.VERBOSE,"VERBOSE"].concat(t))}),(0,_defineProperty2.default)(this,"info",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.output.apply(l,[Type.INFO,"INFO"].concat(t))}),(0,_defineProperty2.default)(this,"wait",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.output.apply(l,[Type.INFO,"WAIT"].concat(t))}),(0,_defineProperty2.default)(this,"success",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.output.apply(l,[Type.SUCCESS,"SUCCESS"].concat(t))}),(0,_defineProperty2.default)(this,"done",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.output.apply(l,[Type.SUCCESS,"DONE"].concat(t))}),(0,_defineProperty2.default)(this,"warning",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.output.apply(l,[Type.WARNING,"WARNING"].concat(t))}),(0,_defineProperty2.default)(this,"error",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.output.apply(l,[Type.ERROR,"ERROR"].concat(t))}),(0,_defineProperty2.default)(this,"failure",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.output.apply(l,[Type.ERROR,"FAILURE"].concat(t))})},fancyNodeLogger=new FancyNodeLogger;fancyNodeLogger.Type=Type,module.exports=fancyNodeLogger; | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault"),_slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")),_classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),Type=require("./Type"),chalk=require("chalk"),FancyNodeLogger=function e(){var i=this;(0,_classCallCheck2.default)(this,e),(0,_defineProperty2.default)(this,"parseMessages",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];switch(null==t?void 0:t.length){case 1:return[t[0]];case 2:return[t[0],null,t[1]];case 3:return[t[0],t[1],t[2]];default:return[]}}),(0,_defineProperty2.default)(this,"getDefaultSeverityStyle",function(e){switch(e){case Type.VERBOSE:return["bgWhite","black"];case Type.INFO:return["bgBlueBright","black"];case Type.SUCCESS:return["bgGreenBright","black"];case Type.WARNING:return["bgYellowBright","black"];case Type.ERROR:return["bgRedBright","black"];default:return["bgWhite","black"]}}),(0,_defineProperty2.default)(this,"getDefaultTitleStyle",function(e){switch(e){case Type.VERBOSE:return["white"];case Type.INFO:return["blueBright"];case Type.SUCCESS:return["greenBright"];case Type.WARNING:return["yellowBright"];case Type.ERROR:return["redBright"];default:return["white"]}}),(0,_defineProperty2.default)(this,"formatText",function(e,t){if(!e)return"";if(!t||(null==t?void 0:t.length)<1)return e;var r=chalk;return null!=t&&t.forEach(function(e){return r=null===r||void 0===r?void 0:r[e]}),r?r("",e,""):e}),(0,_defineProperty2.default)(this,"print",function(e,t,r,n,a,u){t=i.formatText(e,t),t=t?"".concat(t," "):"",r=i.formatText(r,n),n=r?"".concat(r," "):"",u=i.formatText(a,u),u=u?"".concat(r?"\n":"").concat(u,"\n"):"";console.log("".concat(t).concat(n).concat(u))}),(0,_defineProperty2.default)(this,"output",function(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var a=i.parseMessages.apply(i,r),u=(0,_slicedToArray2.default)(a,3),o=u[0],a=u[1],u=u[2];i.print(o,i.getDefaultSeverityStyle(e),a,i.getDefaultTitleStyle(e),u)}),(0,_defineProperty2.default)(this,"note",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.output.apply(i,[Type.VERBOSE,"NOTE"].concat(t))}),(0,_defineProperty2.default)(this,"verbose",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.output.apply(i,[Type.VERBOSE,"VERBOSE"].concat(t))}),(0,_defineProperty2.default)(this,"info",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.output.apply(i,[Type.INFO,"INFO"].concat(t))}),(0,_defineProperty2.default)(this,"wait",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.output.apply(i,[Type.INFO,"WAIT"].concat(t))}),(0,_defineProperty2.default)(this,"success",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.output.apply(i,[Type.SUCCESS,"SUCCESS"].concat(t))}),(0,_defineProperty2.default)(this,"done",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.output.apply(i,[Type.SUCCESS,"DONE"].concat(t))}),(0,_defineProperty2.default)(this,"warning",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.output.apply(i,[Type.WARNING,"WARNING"].concat(t))}),(0,_defineProperty2.default)(this,"issue",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.output.apply(i,[Type.WARNING,"ISSUE"].concat(t))}),(0,_defineProperty2.default)(this,"error",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.output.apply(i,[Type.ERROR,"ERROR"].concat(t))}),(0,_defineProperty2.default)(this,"failure",function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.output.apply(i,[Type.ERROR,"FAILURE"].concat(t))})},fancyNodeLogger=new FancyNodeLogger;fancyNodeLogger.Type=Type,module.exports=fancyNodeLogger; |
{ | ||
"name": "fancy-node-logger", | ||
"author": "liangxiaojun", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Fancy logger in Node with Chalk", | ||
@@ -6,0 +6,0 @@ "main": "./dist/index.js", |
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
6462