cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [1/3] git commit: CB-4718 fixed Console plugin not work on wp
Date Thu, 16 Jan 2014 21:37:13 GMT
Updated Branches:
  refs/heads/dev 3382df968 -> 5c835dc4c


CB-4718 fixed Console plugin not work on wp


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/8c9b1754
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/tree/8c9b1754
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/diff/8c9b1754

Branch: refs/heads/dev
Commit: 8c9b1754d8c10bb1b6b6bbb2dd46b4bd4e6d84ae
Parents: 14e160c
Author: pu-chen <puchen@polyvi.com>
Authored: Thu Oct 31 17:15:11 2013 +0800
Committer: pu-chen <puchen@polyvi.com>
Committed: Thu Oct 31 17:15:11 2013 +0800

----------------------------------------------------------------------
 plugin.xml             |  4 ++--
 src/wp/DebugConsole.cs | 28 +++++++++++++---------------
 2 files changed, 15 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/blob/8c9b1754/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 1311769..9d4eba0 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -37,7 +37,7 @@
     <platform name="wp7">
         <config-file target="config.xml" parent="/*">
             <feature name="Console">
-                <param name="wp-package" value="DebugConsole"/>
+                <param name="wp-package" value="Console"/>
             </feature>
         </config-file>
 
@@ -56,7 +56,7 @@
     <platform name="wp8">
         <config-file target="config.xml" parent="/*">
             <feature name="Console">
-                <param name="wp-package" value="DebugConsole"/>
+                <param name="wp-package" value="Console"/>
             </feature>
         </config-file>
 

http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/blob/8c9b1754/src/wp/DebugConsole.cs
----------------------------------------------------------------------
diff --git a/src/wp/DebugConsole.cs b/src/wp/DebugConsole.cs
index fa9863a..31a7127 100644
--- a/src/wp/DebugConsole.cs
+++ b/src/wp/DebugConsole.cs
@@ -26,24 +26,22 @@ using System.Diagnostics;
 
 namespace WPCordovaClassLib.Cordova.Commands
 {
-
-    public class DebugConsole : BaseCommand
+    public class Console : BaseCommand
     {
-        // warn, error
-        public void log(string msg)
+        public void logLevel(string options)
         {
-            Debug.WriteLine("Log:" + msg);
-        }
+            string[] args = JSON.JsonHelper.Deserialize<string[]>(options);
+            string level = args[0];
+            string msg = args[1];
 
-        public void error(string msg)
-        {
-            Debug.WriteLine("Error:" + msg);
+            if (level.Equals("LOG"))
+            {
+                Debug.WriteLine(msg);
+            }
+            else
+            {
+                Debug.WriteLine(level + ": " + msg);
+            }
         }
-
-        public void warn(string msg)
-        {
-            Debug.WriteLine("Warn:" + msg);
-        }
-
     }
 }


Mime
View raw message