Skip to content

Instantly share code, notes, and snippets.

@dotnetCarpenter
Last active December 15, 2015 11:29
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 dotnetCarpenter/5252915 to your computer and use it in GitHub Desktop.
Save dotnetCarpenter/5252915 to your computer and use it in GitHub Desktop.
Simple logger for browsers
function getLogger() {
var out = document.createElement("ol");
document.body.appendChild(out);
return function log(msg) {
out.innerHTML += "<li>" + msg + "</li>";
}
}
@dotnetCarpenter
Copy link
Author

Usage:

var l = getLogger()
l("Hello");
l("World");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment