Skip to content

Instantly share code, notes, and snippets.

@markhepburn
Created September 8, 2010 23:37
Show Gist options
  • Save markhepburn/571063 to your computer and use it in GitHub Desktop.
Save markhepburn/571063 to your computer and use it in GitHub Desktop.
jQuery.fn.log = function (msg) {
console.log("%s: %o", msg, this);
return this;
};
// $('selector').log('BEGIN')
// .css('color', 'red')
// .log('new value')
// // etc
// From http://msdn.microsoft.com/en-us/scriptjunkie/ee819093.aspx
// which credits http://happygiraffe.net/blog/2007/09/26/jquery-logging/
// (which is unavailable right now)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment