Skip to content

Instantly share code, notes, and snippets.

@yoko
Created June 22, 2009 01:38
Show Gist options
  • Save yoko/133759 to your computer and use it in GitHub Desktop.
Save yoko/133759 to your computer and use it in GitHub Desktop.
debug = !(/^test\.example\.com/.test(location.host));
if (typeof console == 'undefined') {
console = {};
console.log = function() {
try {
var res = [];
for (var i = 0, l = arguments.length; i < l; i++)
res.push(arguments[i].toString());
if ($.browser.opera)
opera.postError(res.join(', '));
}
catch (e) {}
};
}
log = function() {
debug ?
console.log.apply(console.log, arguments) :
null;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment