Skip to content

Instantly share code, notes, and snippets.

@GirlBossRush
Last active January 1, 2016 12:19
Show Gist options
  • Save GirlBossRush/8144041 to your computer and use it in GitHub Desktop.
Save GirlBossRush/8144041 to your computer and use it in GitHub Desktop.
Logger = (function () {
var dateString = function () {}
dateString.toString = function(){
datetime = new Date();
return '[' + datetime.getHours() + ':' + datetime.getMinutes() + ':' + datetime.getMilliseconds() + ']';
};
return {
debug: console.debug.bind(
console,
"%c[%s] %c[%s] [%s]",
"color: DeepPink",
"info", "color: black",
dateString),
error: console.error.bind(
console,
"%c[%s] %c[%s] [%s]",
"color: Red",
"info", "color: black",
dateString),
info: console.info.bind(
console,
"%c[%s] %c[%s] [%s]",
"color: DarkSlateBlue",
"info", "color: black",
dateString),
log: console.log.bind(
console,
"%c[%s] %c[%s] [%s]",
"color: DarkGreen",
"info", "color: black",
dateString),
warn: console.warn.bind(
console,
"%c[%s] %c[%s] [%s]",
"color: DarkOrange",
"info", "color: black",
dateString),
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment