Skip to content

Commit

Permalink
In IE, the console functions aren't "function", but are "objects". As…
Browse files Browse the repository at this point in the history
… such they don't have an .apply method.
  • Loading branch information
jbaudanza committed May 18, 2011
1 parent 10cf4f8 commit 8e11056
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/davis.logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Davis.logger = (function () {
var prepArgs = function (args) {
var a = Davis.utils.toArray(args)
a.unshift(timestamp())
return a
return a.join(' ');
}

/**
Expand All @@ -39,7 +39,7 @@ Davis.logger = (function () {
* @params {String} All arguments are combined and logged to the console.
*/
var error = function () {
if (window.console) console.error.apply(console, prepArgs(arguments))
if (window.console) console.error(prepArgs(arguments));
}

/**
Expand All @@ -49,7 +49,7 @@ Davis.logger = (function () {
* @params {String} All arguments are combined and logged to the console.
*/
var info = function () {
if (window.console) console.info.apply(console, prepArgs(arguments))
if (window.console) console.info(prepArgs(arguments));
}

/**
Expand All @@ -59,7 +59,7 @@ Davis.logger = (function () {
* @params {String} All arguments are combined and logged to the console.
*/
var warn = function () {
if (window.console) console.warn.apply(console, prepArgs(arguments))
if (window.console) console.warn(prepArgs(arguments));
}

/**
Expand Down

0 comments on commit 8e11056

Please sign in to comment.