From 8e644077a1a5da49bc914778205badfa809024f6 Mon Sep 17 00:00:00 2001 From: Daniel Imhoff Date: Tue, 15 Aug 2017 18:28:21 -0500 Subject: [PATCH] fix(serve): fix --consolelogs/--serverlogs usage with Cordova console plugin fixes https://github.com/ionic-team/ionic-cli/issues/2243 --- bin/ion-dev.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/ion-dev.js b/bin/ion-dev.js index 2442f618..463f1962 100644 --- a/bin/ion-dev.js +++ b/bin/ion-dev.js @@ -169,10 +169,10 @@ window.IonicDevServer = { })(); } - for (var consoleType in console) { - if (console.hasOwnProperty(consoleType) && typeof console[consoleType] === 'function') { - patchConsole(consoleType); - } + // https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-console/#supported-methods + var consoleFns = ['log', 'error', 'exception', 'warn', 'info', 'debug', 'assert', 'dir', 'dirxml', 'time', 'timeEnd', 'table']; + for (var i in consoleFns) { + patchConsole(consoleFns[i]); } },