Skip to content

Instantly share code, notes, and snippets.

@nathanl
Created December 10, 2010 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanl/736738 to your computer and use it in GitHub Desktop.
Save nathanl/736738 to your computer and use it in GitHub Desktop.
A simple wrapper for console.log that doesn't break anything if the user has no console to call
function safelog(message) {
try{ console.log(message); } catch(e){ /*do nothing*/ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment