aboutsummaryrefslogtreecommitdiffstats
path: root/src/service
diff options
context:
space:
mode:
Diffstat (limited to 'src/service')
-rw-r--r--src/service/log.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/service/log.js b/src/service/log.js
index d338985a..d9d8994d 100644
--- a/src/service/log.js
+++ b/src/service/log.js
@@ -93,19 +93,23 @@ function $LogProvider(){
}
function consoleLog(type) {
- var console = $window.console || {};
- var logFn = console[type] || console.log || noop;
+ var console = $window.console || {},
+ logFn = console[type] || console.log || noop;
+
if (logFn.apply) {
return function() {
var args = [];
- forEach(arguments, function(arg){
+ forEach(arguments, function(arg) {
args.push(formatError(arg));
});
return logFn.apply(console, args);
};
- } else {
- // we are IE, in which case there is nothing we can do
- return logFn;
+ }
+
+ // we are IE which either doesn't have window.console => this is noop and we do nothing,
+ // or we are IE where console.log doesn't have apply so we log at least first 2 args
+ return function(arg1, arg2) {
+ logFn(arg1, arg2);
}
}
}];