Skip to content

Instantly share code, notes, and snippets.

@laustdeleuran
Created February 6, 2012 11:24
Show Gist options
  • Save laustdeleuran/1751602 to your computer and use it in GitHub Desktop.
Save laustdeleuran/1751602 to your computer and use it in GitHub Desktop.
Vertic Lib Logger Class Constructor
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