-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjquery.logging.min.js
More file actions
1 lines (1 loc) · 943 Bytes
/
jquery.logging.min.js
File metadata and controls
1 lines (1 loc) · 943 Bytes
1
(function(e){e.fn.log=function(e){this.getType=function(e){try{if(typeof e==="undefined")return"undefined";if(typeof e==="object"&&!e)return"null";return{}.toString.call(e).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}catch(t){return"undefined"}};this.isConsole=function(){return this.console!==undefined&&this.console!==null&&this.console.log!==undefined};this.isString=function(e){var t=this.getType(e);return t==="string"||t==="number"||t==="boolean"};this.getConsolVal=function(e){if(e!==undefined&&e!==null&&this.getType(e)){if(this.isString(e)){return e}else if(this.getType(e)==="object"){return e}else{return this.getType(e)}}return undefined};this.getTextVal=function(e){if(e!==undefined&&e!==null&&this.getType(e)){if(this.isString(e)){return e}}return undefined};if(this.isConsole()){var t=this.getConsolVal(e);if(t!==undefined&&t!==null&&t!=="undefined"&&t!=="null"){console.log(t)}else{console.log("Value in undefined")}}}})(jQuery)