Skip to content

Instantly share code, notes, and snippets.

@bryanbuchanan
Last active October 13, 2015 23:38
Show Gist options
  • Save bryanbuchanan/4274165 to your computer and use it in GitHub Desktop.
Save bryanbuchanan/4274165 to your computer and use it in GitHub Desktop.
Wrapper for console.log command
// Logger only works when develop == true
var develop = true;
function log(message, line) {
if (window.console && window.log && develop) {
var line = typeof line !== "undefined" ? line : false;
if (line) {
if (typeof message === "string") {
console.log(message + " (Line " + line + ")");
} else {
console.log("Line " + line + ":");
console.log(message);
}
} else {
console.log(message);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment