Permalink
Browse files

Update microee dependency, rerun make build

  • Loading branch information...
1 parent d9c1b56 commit cd7ee9c5a0d65b19ca85a077dbf5c130a6ef0dbb @mixu committed Jan 5, 2017
Showing with 27 additions and 15 deletions.
  1. +26 −14 dist/minilog.js
  2. +1 −1 package.json
View
@@ -2,45 +2,57 @@
var r=function(){var e="function"==typeof require&&require,r=function(i,o,u){o||(o=0);var n=r.resolve(i,o),t=r.m[o][n];if(!t&&e){if(t=e(n))return t}else if(t&&t.c&&(o=t.c,n=t.m,t=r.m[o][t.m],!t))throw new Error('failed to require "'+n+'" from '+o);if(!t)throw new Error('failed to require "'+i+'" from '+u);return t.exports||(t.exports={},t.call(t.exports,t,t.exports,r.relative(n,o))),t.exports};return r.resolve=function(e,n){var i=e,t=e+".js",o=e+"/index.js";return r.m[n][t]&&t?t:r.m[n][o]&&o?o:i},r.relative=function(e,t){return function(n){if("."!=n.charAt(0))return r(n,t,e);var o=e.split("/"),f=n.split("/");o.pop();for(var i=0;i<f.length;i++){var u=f[i];".."==u?o.pop():"."!=u&&o.push(u)}return r(o.join("/"),t,e)}},r}();r.m = [];
r.m[0] = {
"microee": {"c":2,"m":"index.js"},
-"lib/web/index.js": function(module, exports, require){
-var e=require("../common/minilog.js"),t=e.enable,n=e.disable,r=typeof navigator!="undefined"&&/chrome/i.test(navigator.userAgent),i=require("./console.js");e.defaultBackend=r?i.minilog:i;if(typeof window!="undefined"){try{e.enable(JSON.parse(window.localStorage.minilogSettings))}catch(s){}if(window.location&&window.location.search){var o=RegExp("[?&]minilog=([^&]*)").exec(window.location.search);o&&e.enable(decodeURIComponent(o[1]))}}e.enable=function(){t.call(e,!0);try{window.localStorage.minilogSettings=JSON.stringify(!0)}catch(n){}return this},e.disable=function(){n.call(e);try{delete window.localStorage.minilogSettings}catch(t){}return this},exports=module.exports=e,exports.backends={array:require("./array.js"),browser:e.defaultBackend,localStorage:require("./localstorage.js"),jQuery:require("./jquery_simple.js")};
-},
"lib/web/array.js": function(module, exports, require){
-var e=require("../common/transform.js"),t=[],n=new e;n.write=function(e,n,r){t.push([e,n,r])},n.get=function(){return t},n.empty=function(){t=[]},module.exports=n;
+var Transform=require("../common/transform.js"),cache=[];var logger=new Transform;logger.write=function(name,level,args){cache.push([name,level,args])};logger.get=function(){return cache};logger.empty=function(){cache=[]};module.exports=logger;
+
+},
+"lib/web/index.js": function(module, exports, require){
+var Minilog=require("../common/minilog.js");var oldEnable=Minilog.enable,oldDisable=Minilog.disable,isChrome=typeof navigator!="undefined"&&/chrome/i.test(navigator.userAgent),console=require("./console.js");Minilog.defaultBackend=isChrome?console.minilog:console;if(typeof window!="undefined"){try{Minilog.enable(JSON.parse(window.localStorage["minilogSettings"]))}catch(e){}if(window.location&&window.location.search){var match=RegExp("[?&]minilog=([^&]*)").exec(window.location.search);match&&Minilog.enable(decodeURIComponent(match[1]))}}Minilog.enable=function(){oldEnable.call(Minilog,true);try{window.localStorage["minilogSettings"]=JSON.stringify(true)}catch(e){}return this};Minilog.disable=function(){oldDisable.call(Minilog);try{delete window.localStorage.minilogSettings}catch(e){}return this};exports=module.exports=Minilog;exports.backends={array:require("./array.js"),browser:Minilog.defaultBackend,localStorage:require("./localstorage.js"),jQuery:require("./jquery_simple.js")};
+
},
"lib/web/console.js": function(module, exports, require){
-var e=require("../common/transform.js"),t=/\n+$/,n=new e;n.write=function(e,n,r){var i=r.length-1;if(typeof console=="undefined"||!console.log)return;if(console.log.apply)return console.log.apply(console,[e,n].concat(r));if(JSON&&JSON.stringify){r[i]&&typeof r[i]=="string"&&(r[i]=r[i].replace(t,""));try{for(i=0;i<r.length;i++)r[i]=JSON.stringify(r[i])}catch(s){}console.log(r.join(" "))}},n.formatters=["color","minilog"],n.color=require("./formatters/color.js"),n.minilog=require("./formatters/minilog.js"),module.exports=n;
+var Transform=require("../common/transform.js");var newlines=/\n+$/,logger=new Transform;logger.write=function(name,level,args){var i=args.length-1;if(typeof console==="undefined"||!console.log){return}if(console.log.apply){return console.log.apply(console,[name,level].concat(args))}else if(JSON&&JSON.stringify){if(args[i]&&typeof args[i]=="string"){args[i]=args[i].replace(newlines,"")}try{for(i=0;i<args.length;i++){args[i]=JSON.stringify(args[i])}}catch(e){}console.log(args.join(" "))}};logger.formatters=["color","minilog"];logger.color=require("./formatters/color.js");logger.minilog=require("./formatters/minilog.js");module.exports=logger;
+
},
"lib/common/filter.js": function(module, exports, require){
-function n(){this.enabled=!0,this.defaultResult=!0,this.clear()}function r(e,t){return e.n.test?e.n.test(t):e.n==t}var e=require("./transform.js"),t={debug:1,info:2,warn:3,error:4};e.mixin(n),n.prototype.allow=function(e,n){return this._white.push({n:e,l:t[n]}),this},n.prototype.deny=function(e,n){return this._black.push({n:e,l:t[n]}),this},n.prototype.clear=function(){return this._white=[],this._black=[],this},n.prototype.test=function(e,n){var i,s=Math.max(this._white.length,this._black.length);for(i=0;i<s;i++){if(this._white[i]&&r(this._white[i],e)&&t[n]>=this._white[i].l)return!0;if(this._black[i]&&r(this._black[i],e)&&t[n]<this._black[i].l)return!1}return this.defaultResult},n.prototype.write=function(e,t,n){if(!this.enabled||this.test(e,t))return this.emit("item",e,t,n)},module.exports=n;
+var Transform=require("./transform.js");var levelMap={debug:1,info:2,warn:3,error:4};function Filter(){this.enabled=true;this.defaultResult=true;this.clear()}Transform.mixin(Filter);Filter.prototype.allow=function(name,level){this._white.push({n:name,l:levelMap[level]});return this};Filter.prototype.deny=function(name,level){this._black.push({n:name,l:levelMap[level]});return this};Filter.prototype.clear=function(){this._white=[];this._black=[];return this};function test(rule,name){return rule.n.test?rule.n.test(name):rule.n==name}Filter.prototype.test=function(name,level){var i,len=Math.max(this._white.length,this._black.length);for(i=0;i<len;i++){if(this._white[i]&&test(this._white[i],name)&&levelMap[level]>=this._white[i].l){return true}if(this._black[i]&&test(this._black[i],name)&&levelMap[level]<=this._black[i].l){return false}}return this.defaultResult};Filter.prototype.write=function(name,level,args){if(!this.enabled||this.test(name,level)){return this.emit("item",name,level,args)}};module.exports=Filter;
+
},
"lib/common/minilog.js": function(module, exports, require){
-var e=require("./transform.js"),t=require("./filter.js"),n=new e,r=Array.prototype.slice;exports=module.exports=function(t){var i=function(){return n.write(t,undefined,r.call(arguments)),i};return i.debug=function(){return n.write(t,"debug",r.call(arguments)),i},i.info=function(){return n.write(t,"info",r.call(arguments)),i},i.warn=function(){return n.write(t,"warn",r.call(arguments)),i},i.error=function(){return n.write(t,"error",r.call(arguments)),i},i.log=i.debug,i.suggest=exports.suggest,i.format=n.format,i},exports.defaultBackend=exports.defaultFormatter=null,exports.pipe=function(e){return n.pipe(e)},exports.end=exports.unpipe=exports.disable=function(e){return n.unpipe(e)},exports.Transform=e,exports.Filter=t,exports.suggest=new t,exports.enable=function(){return exports.defaultFormatter?n.pipe(exports.suggest).pipe(exports.defaultFormatter).pipe(exports.defaultBackend):n.pipe(exports.suggest).pipe(exports.defaultBackend)};
+var Transform=require("./transform.js"),Filter=require("./filter.js");var log=new Transform,slice=Array.prototype.slice;exports=module.exports=function create(name){var o=function(){log.write(name,undefined,slice.call(arguments));return o};o.debug=function(){log.write(name,"debug",slice.call(arguments));return o};o.info=function(){log.write(name,"info",slice.call(arguments));return o};o.warn=function(){log.write(name,"warn",slice.call(arguments));return o};o.error=function(){log.write(name,"error",slice.call(arguments));return o};o.log=o.debug;o.suggest=exports.suggest;o.format=log.format;return o};exports.defaultBackend=exports.defaultFormatter=null;exports.pipe=function(dest){return log.pipe(dest)};exports.end=exports.unpipe=exports.disable=function(from){return log.unpipe(from)};exports.Transform=Transform;exports.Filter=Filter;exports.suggest=new Filter;exports.enable=function(){if(exports.defaultFormatter){return log.pipe(exports.suggest).pipe(exports.defaultFormatter).pipe(exports.defaultBackend)}return log.pipe(exports.suggest).pipe(exports.defaultBackend)};
+
},
"lib/common/transform.js": function(module, exports, require){
-function t(){}var e=require("microee");e.mixin(t),t.prototype.write=function(e,t,n){this.emit("item",e,t,n)},t.prototype.end=function(){this.emit("end"),this.removeAllListeners()},t.prototype.pipe=function(e){function n(){e.write.apply(e,Array.prototype.slice.call(arguments))}function r(){!e._isStdio&&e.end()}var t=this;return t.emit("unpipe",e),e.emit("pipe",t),t.on("item",n),t.on("end",r),t.when("unpipe",function(i){var o=i===e||typeof i=="undefined";return o&&(t.removeListener("item",n),t.removeListener("end",r),e.emit("unpipe")),o}),e},t.prototype.unpipe=function(e){return this.emit("unpipe",e),this},t.prototype.format=function(e){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},t.mixin=function(e){var n=t.prototype,r;for(r in n)n.hasOwnProperty(r)&&(e.prototype[r]=n[r])},module.exports=t;
+var microee=require("microee");function Transform(){}microee.mixin(Transform);Transform.prototype.write=function(name,level,args){this.emit("item",name,level,args)};Transform.prototype.end=function(){this.emit("end");this.removeAllListeners()};Transform.prototype.pipe=function(dest){var s=this;s.emit("unpipe",dest);dest.emit("pipe",s);function onItem(){dest.write.apply(dest,Array.prototype.slice.call(arguments))}function onEnd(){!dest._isStdio&&dest.end()}s.on("item",onItem);s.on("end",onEnd);s.when("unpipe",function(from){var match=from===dest||typeof from=="undefined";if(match){s.removeListener("item",onItem);s.removeListener("end",onEnd);dest.emit("unpipe")}return match});return dest};Transform.prototype.unpipe=function(from){this.emit("unpipe",from);return this};Transform.prototype.format=function(dest){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))};Transform.mixin=function(dest){var o=Transform.prototype,k;for(k in o){o.hasOwnProperty(k)&&(dest.prototype[k]=o[k])}};module.exports=Transform;
+
},
"lib/web/localstorage.js": function(module, exports, require){
-var e=require("../common/transform.js"),t=!1,n=new e;n.write=function(e,n,r){if(typeof window=="undefined"||typeof JSON=="undefined"||!JSON.stringify||!JSON.parse)return;try{t||(t=window.localStorage.minilog?JSON.parse(window.localStorage.minilog):[]),t.push([(new Date).toString(),e,n,r]),window.localStorage.minilog=JSON.stringify(t)}catch(i){}},module.exports=n;
+var Transform=require("../common/transform.js"),cache=false;var logger=new Transform;logger.write=function(name,level,args){if(typeof window=="undefined"||typeof JSON=="undefined"||!JSON.stringify||!JSON.parse)return;try{if(!cache){cache=window.localStorage.minilog?JSON.parse(window.localStorage.minilog):[]}cache.push([(new Date).toString(),name,level,args]);window.localStorage.minilog=JSON.stringify(cache)}catch(e){}};module.exports=logger;
+
},
"lib/web/jquery_simple.js": function(module, exports, require){
-function n(e){this.url=e.url||"",this.cache=[],this.timer=null,this.interval=e.interval||3e4,this.enabled=!0,this.jQuery=window.jQuery,this.extras={}}var e=require("../common/transform.js"),t=(new Date).valueOf().toString(36);e.mixin(n),n.prototype.write=function(e,t,n){this.timer||this.init(),this.cache.push([e,t].concat(n))},n.prototype.init=function(){if(!this.enabled||!this.jQuery)return;var e=this;this.timer=setTimeout(function(){var n,r=[],i,s=e.url;if(e.cache.length==0)return e.init();for(n=0;n<e.cache.length;n++)try{r.push(JSON.stringify(e.cache[n]))}catch(o){}e.jQuery.isEmptyObject(e.extras)?(i=r.join("\n"),s=e.url+"?client_id="+t):i=JSON.stringify(e.jQuery.extend({logs:r},e.extras)),e.jQuery.ajax(s,{type:"POST",cache:!1,processData:!1,data:i,contentType:"application/json",timeout:1e4}).success(function(t,n,r){t.interval&&(e.interval=Math.max(1e3,t.interval))}).error(function(){e.interval=3e4}).always(function(){e.init()}),e.cache=[]},this.interval)},n.prototype.end=function(){},n.jQueryWait=function(e){if(typeof window!="undefined"&&(window.jQuery||window.$))return e(window.jQuery||window.$);typeof window!="undefined"&&setTimeout(function(){n.jQueryWait(e)},200)},module.exports=n;
+var Transform=require("../common/transform.js");var cid=(new Date).valueOf().toString(36);function AjaxLogger(options){this.url=options.url||"";this.cache=[];this.timer=null;this.interval=options.interval||30*1e3;this.enabled=true;this.jQuery=window.jQuery;this.extras={}}Transform.mixin(AjaxLogger);AjaxLogger.prototype.write=function(name,level,args){if(!this.timer){this.init()}this.cache.push([name,level].concat(args))};AjaxLogger.prototype.init=function(){if(!this.enabled||!this.jQuery)return;var self=this;this.timer=setTimeout(function(){var i,logs=[],ajaxData,url=self.url;if(self.cache.length==0)return self.init();for(i=0;i<self.cache.length;i++){try{JSON.stringify(self.cache[i]);logs.push(self.cache[i])}catch(e){}}if(self.jQuery.isEmptyObject(self.extras)){ajaxData=JSON.stringify({logs:logs});url=self.url+"?client_id="+cid}else{ajaxData=JSON.stringify(self.jQuery.extend({logs:logs},self.extras))}self.jQuery.ajax(url,{type:"POST",cache:false,processData:false,data:ajaxData,contentType:"application/json",timeout:1e4}).success(function(data,status,jqxhr){if(data.interval){self.interval=Math.max(1e3,data.interval)}}).error(function(){self.interval=3e4}).always(function(){self.init()});self.cache=[]},this.interval)};AjaxLogger.prototype.end=function(){};AjaxLogger.jQueryWait=function(onDone){if(typeof window!=="undefined"&&(window.jQuery||window.$)){return onDone(window.jQuery||window.$)}else if(typeof window!=="undefined"){setTimeout(function(){AjaxLogger.jQueryWait(onDone)},200)}};module.exports=AjaxLogger;
+
},
"lib/web/formatters/util.js": function(module, exports, require){
-function t(t,n){return n?"color: #fff; background: "+e[t]+";":"color: "+e[t]+";"}var e={black:"#000",red:"#c23621",green:"#25bc26",yellow:"#bbbb00",blue:"#492ee1",magenta:"#d338d3",cyan:"#33bbc8",gray:"#808080",purple:"#708"};module.exports=t;
+var hex={black:"#000",red:"#c23621",green:"#25bc26",yellow:"#bbbb00",blue:"#492ee1",magenta:"#d338d3",cyan:"#33bbc8",gray:"#808080",purple:"#708"};function color(fg,isInverse){if(isInverse){return"color: #fff; background: "+hex[fg]+";"}else{return"color: "+hex[fg]+";"}}module.exports=color;
+
},
"lib/web/formatters/color.js": function(module, exports, require){
-var e=require("../../common/transform.js"),t=require("./util.js"),n={debug:["cyan"],info:["purple"],warn:["yellow",!0],error:["red",!0]},r=new e;r.write=function(e,r,i){var s=console.log;console[r]&&console[r].apply&&(s=console[r],s.apply(console,["%c"+e+" %c"+r,t("gray"),t.apply(t,n[r])].concat(i)))},r.pipe=function(){},module.exports=r;
+var Transform=require("../../common/transform.js"),color=require("./util.js");var colors={debug:["cyan"],info:["purple"],warn:["yellow",true],error:["red",true]},logger=new Transform;logger.write=function(name,level,args){var fn=console.log;if(console[level]&&console[level].apply){fn=console[level];fn.apply(console,["%c"+name+" %c"+level,color("gray"),color.apply(color,colors[level])].concat(args))}};logger.pipe=function(){};module.exports=logger;
+
},
"lib/web/formatters/minilog.js": function(module, exports, require){
-var e=require("../../common/transform.js"),t=require("./util.js");colors={debug:["gray"],info:["purple"],warn:["yellow",!0],error:["red",!0]},logger=new e,logger.write=function(e,n,r){var i=console.log;n!="debug"&&console[n]&&(i=console[n]);var s=[],o=0;if(n!="info"){for(;o<r.length;o++)if(typeof r[o]!="string")break;i.apply(console,["%c"+e+" "+r.slice(0,o).join(" "),t.apply(t,colors[n])].concat(r.slice(o)))}else i.apply(console,["%c"+e,t.apply(t,colors[n])].concat(r))},logger.pipe=function(){},module.exports=logger;
+var Transform=require("../../common/transform.js"),color=require("./util.js"),colors={debug:["gray"],info:["purple"],warn:["yellow",true],error:["red",true]},logger=new Transform;logger.write=function(name,level,args){var fn=console.log;if(level!="debug"&&console[level]){fn=console[level]}var subset=[],i=0;if(level!="info"){for(;i<args.length;i++){if(typeof args[i]!="string")break}fn.apply(console,["%c"+name+" "+args.slice(0,i).join(" "),color.apply(color,colors[level])].concat(args.slice(i)))}else{fn.apply(console,["%c"+name,color.apply(color,colors[level])].concat(args))}};logger.pipe=function(){};module.exports=logger;
+
}
};
r.m[1] = {
};
r.m[2] = {
"index.js": function(module, exports, require){
-function e(){this._events={}}e.prototype={on:function(e,t){this._events||(this._events={});var n=this._events;return(n[e]||(n[e]=[])).push(t),this},removeListener:function(e,t){var n=this._events[e]||[],r;for(r=n.length-1;r>=0&&n[r];r--)(n[r]===t||n[r].cb===t)&&n.splice(r,1)},removeAllListeners:function(e){e?this._events[e]&&(this._events[e]=[]):this._events={}},emit:function(e){this._events||(this._events={});var t=Array.prototype.slice.call(arguments,1),n,r=this._events[e]||[];for(n=r.length-1;n>=0&&r[n];n--)r[n].apply(this,t);return this},when:function(e,t){return this.once(e,t,!0)},once:function(e,t,n){function r(){n||this.removeListener(e,r),t.apply(this,arguments)&&n&&this.removeListener(e,r)}return t?(r.cb=t,this.on(e,r),this):this}},e.mixin=function(t){var n=e.prototype,r;for(r in n)n.hasOwnProperty(r)&&(t.prototype[r]=n[r])},module.exports=e;
+function M(){this._events={}}M.prototype={on:function(ev,cb){this._events||(this._events={});var e=this._events;(e[ev]||(e[ev]=[])).push(cb);return this},removeListener:function(ev,cb){var e=this._events[ev]||[],i;for(i=e.length-1;i>=0&&e[i];i--){if(e[i]===cb||e[i].cb===cb){e.splice(i,1)}}},removeAllListeners:function(ev){if(!ev){this._events={}}else{this._events[ev]&&(this._events[ev]=[])}},listeners:function(ev){return this._events?this._events[ev]||[]:[]},emit:function(ev){this._events||(this._events={});var args=Array.prototype.slice.call(arguments,1),i,e=this._events[ev]||[];for(i=e.length-1;i>=0&&e[i];i--){e[i].apply(this,args)}return this},when:function(ev,cb){return this.once(ev,cb,true)},once:function(ev,cb,when){if(!cb)return this;function c(){if(!when)this.removeListener(ev,c);if(cb.apply(this,arguments)&&when)this.removeListener(ev,c)}c.cb=cb;this.on(ev,c);return this}};M.mixin=function(dest){var o=M.prototype,k;for(k in o){o.hasOwnProperty(k)&&(dest.prototype[k]=o[k])}};module.exports=M;
+
}
};
Minilog = r("lib/web/index.js");}());
View
@@ -5,7 +5,7 @@
"version": "3.0.1",
"main": "lib/index.js",
"dependencies": {
- "microee": "0.0.2"
+ "microee": "0.0.6"
},
"devDependencies": {
"mocha": "*",

0 comments on commit cd7ee9c

Please sign in to comment.