Created
February 6, 2012 11:24
-
-
Save laustdeleuran/1751602 to your computer and use it in GitHub Desktop.
Vertic Lib Logger Class Constructor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _Log = function(obj){ | |
// Set defaults | |
this.history = []; | |
this.debug = false; | |
this.domConsole = false; | |
this.meta = true; | |
this.name = 'Vertic Log'; | |
// Update settings | |
if (typeof obj === 'object') { | |
if (typeof obj.debug === 'boolean') this.debug = obj.debug; | |
if (typeof obj.name === 'string') this.name = obj.name; | |
if (typeof obj.meta === 'boolean') this.meta = obj.meta; | |
if (obj.domConsole) { | |
this.domConsole = true; | |
} | |
} | |
// Check for jQuery to allow domConsole | |
if ($) { // Require jQuery because I'm lazy | |
this.canDoDomConsole = true; | |
} | |
return this; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment