PS3_Toolset/js/logger.min.js

2 lines
7.3 KiB
JavaScript
Raw Normal View History

!function(e){"use strict";function p(e){return"function"==typeof e||"[object Function]"===t.call(e)}function f(e){var t,n=(t=Number(e),isNaN(t)?0:0!==t&&isFinite(t)?(0<t?1:-1)*Math.floor(Math.abs(t)):t);return Math.min(Math.max(n,0),r)}var t,r,o,i,l,a;Array.from||(Array.from=(t=Object.prototype.toString,r=Math.pow(2,53)-1,function(e,t,n){var r=Object(e);if(null==e)throw new TypeError("Array.from requires an array-like object - not null or undefined");var o,i=1<arguments.length?t:void 0;if(void 0!==i){if(!p(i))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(o=n)}for(var l,a=f(r.length),s=p(this)?Object(new this(a)):new Array(a),c=0;c<a;)l=r[c],s[c]=i?void 0===o?i(l,c):i.call(o,l,c):l,c+=1;return s.length=a,s})),Object.keys||(Object.keys=Object.keys||(o=Object.prototype.hasOwnProperty,i=!{toString:null}.propertyIsEnumerable("toString"),a=(l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)o.call(e,n)&&t.push(n);if(i)for(var r=0;r<a;r++)o.call(e,l[r])&&t.push(l[r]);return t}));function s(e){var t=Object.keys(e);t.sort(function(e,t){return e===t?0:t<e?1:-1});for(var n='<span class="dropdown" ><span class="ui-icon icon-triangle"></span><span>'+e+'</span><span class="dropdown-content">',r=0;r<t.length;r++){var o=e[t[r]];"number"==typeof o&&(o="0x"+o.toString(16)),n+='<span><span class="dd-left">'+t[r]+'</span><span class="dd-centre">=</span><span class="dd-right">'+o+"</span></span><br>"}return n+="</span></span>"}function n(e){var t=document.createEvent("Event");t.initEvent("addLog",!1,!1),t.message=e,window.jQuery&&(t.immediate=4===window.jQuery("#tabs").tabs("option","active")),frames.ifrlog.window.document.dispatchEvent(t)}function c(e){if(document.getElementById("inet").checked&&0<e.length)for(var t=0;t<e.length;t++){var n=null;e[t]&&"string"==typeof e[t]&&0<e[t].length?n=e[t]:"number"==typeof e[t]?n="0x"+e[t].toString(16):"boolean"==typeof e[t]?n=e[t].toString():"object"==typeof e[t]?s(e[t]):"function"==typeof e[t]&&e[t],n&&("<br>"===n.substr(0,4)&&(n=n.substr(4,n.length-4)),r="<br>",o="\n ",n=n.replace(new RegExp(function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}(r),"g"),o),helper&&helper.bc&&helper.bc.send(n))}var r,o}function u(e,t){return function(){return t.apply(e,arguments)}}function g(){for(var e,t=arguments,n=t[0],r=1;r<t.length;r++)for(e in t[r])e in n||!t[r].hasOwnProperty(e)||(n[e]=t[r][e]);return n}var d,h={VERSION:"1.7.1-bg"},b={};function v(e,t){return{value:e,name:t}}h.TRACE=v(1,"TRACE"),h.DEBUG=v(2,"DEBUG"),h.INFO=v(3,"INFO"),h.TIME=v(4,"TIME"),h.WARN=v(5,"WARN"),h.ERROR=v(8,"ERROR"),h.OFF=v(99,"OFF");function y(e){this.context=e,this.setLevel(e.filterLevel),this.log=this.info}y.prototype={_iptlog:"ilog",_iptwrn:"iwarn",_ipterr:"ierror",_iptdbg:"idbg",_iptnet:"inet",_tbip:"ip_txtbox",_tbport:"port_txtbox",iptlog:function(){return this._iptlog},iptwrn:function(){return this._iptwrn},ipterr:function(){return this._ipterr},iptdbg:function(){return this._iptdbg},iptnet:function(){return this._iptnet},tbip:function(){return this._tbip},tbport:function(){return this._tbport},setGUI:function(e){window.jQuery&&(0<window.jQuery("#"+e.info).length&&(this._iptlog=e.info),0<window.jQuery("#"+e.warn).length&&(this._iptwrn=e.warn),0<window.jQuery("#"+e.error).length&&(this._ipterr=e.error),0<window.jQuery("#"+e.dbg).length&&(this._iptdbg=e.dbg),0<window.jQuery("#"+e.net).length&&(this._iptnet=e.net),0<window.jQuery("#"+e.ip).length&&(this._tbip=e.ip),0<window.jQuery("#"+e.port).length&&(this._tbport=e.port))},setLevel:function(e){e&&"value"in e&&(this.context.filterLevel=e)},getLevel:function(){return this.context.filterLevel},enabledFor:function(e){var t=this.context.filterLevel;return e.value>=t.value},trace:function(){this.invoke(h.TRACE,arguments),c(arguments)},debug:function(){this.invoke(h.DEBUG,arguments);for(var e="<p