Permalink
Browse files

better detection for whether the console prototype hack logger will work

  • Loading branch information...
1 parent e19d79c commit 96d5a70b234f5112d9a5da37102735f99b23eb5c Paul Baumgart committed Aug 16, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 filters/logger/logger.js
View
@@ -5,9 +5,10 @@ function Logger() {
}
}
-if (typeof console !== 'undefined' && typeof console.log === 'function') {
+try {
Logger.prototype = console;
-} else { // for the dreaded IE, which doesn't allow console.log.apply
+ (new Logger).groupEnd();
+} catch (e) {
function getLogFunction(name) {
return function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {
if (typeof console !== 'undefined') {

0 comments on commit 96d5a70

Please sign in to comment.