You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2013/10/22 19:24:17 UTC

git commit: CB-5154 log formatting incorrectly to native

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 <wj...@gmail.com>
Authored: Tue Oct 22 13:20:15 2013 -0400
Committer: James Jong <wj...@gmail.com>
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) {