Skip to content

Instantly share code, notes, and snippets.

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 specktator/72c774128234466386ac to your computer and use it in GitHub Desktop.
Save specktator/72c774128234466386ac to your computer and use it in GitHub Desktop.
javascript prefixing console.log without affecting line number
logger = function(){
prefix = "MyApp \u2771\u2771\u2771\u2771 ";
this.log = console.log.bind(window.console,prefix);
return this;
}
bugger = new logger();
bugger.log("logging...1");
bugger.log("logging...2");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment