Updated Branches: refs/heads/dev 8892514f0 -> aef8d8fff
CB-5154 log formatting incorrectly to native -only add format string if non-empty Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/commit/aef8d8ff Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/tree/aef8d8ff Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/diff/aef8d8ff Branch: refs/heads/dev Commit: aef8d8fff6b7181091c63dd4fa2bf4a636efb0a3 Parents: 8892514 Author: James Jong <[email protected]> Authored: Tue Oct 22 13:20:15 2013 -0400 Committer: James Jong <[email protected]> Committed: Tue Oct 22 13:20:15 2013 -0400 ---------------------------------------------------------------------- www/logger.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/blob/aef8d8ff/www/logger.js ---------------------------------------------------------------------- diff --git a/www/logger.js b/www/logger.js index 0e838b5..cbf81b9 100644 --- a/www/logger.js +++ b/www/logger.js @@ -209,7 +209,11 @@ function formatStringForMessage(message) { logger.logLevel = function(level /* , ... */) { // format the message with the parameters var formatArgs = [].slice.call(arguments, 1); - formatArgs.unshift(formatStringForMessage(formatArgs[0])); // add formatString + var fmtString = formatStringForMessage(formatArgs[0]); + if (fmtString.length > 0){ + formatArgs.unshift(fmtString); // add formatString + } + var message = logger.format.apply(logger.format, formatArgs); if (LevelsMap[level] === null) {
