Added event logs to Android/Tizen for Primitive Service Assigned Jira issue IOT-555
authorarafat.hsn <arafat.hsn@samsung.com>
Mon, 15 Jun 2015 12:08:08 +0000 (18:08 +0600)
committerUze Choi <uzchoi@samsung.com>
Mon, 22 Jun 2015 06:43:47 +0000 (06:43 +0000)
Change-Id: I96dc633ac1b3117cbd2e00e14fd9797e81297160
Signed-off-by: arafat.hsn <arafat.hsn@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1276
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Hun-je Yeon <hunje.yeon@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
29 files changed:
service/notification-manager/SampleApp/android/ResourceHostingSampleApp/src/com/example/resourcehostingsampleapp/ResourceHosting.java
service/notification-manager/SampleApp/android/SampleConsumer/src/com/example/sample/consumer/SampleConsumer.java
service/notification-manager/SampleApp/android/SampleProviderApp/src/com/example/sample/provider/SampleProvider.java
service/notification-manager/SampleApp/android/SampleProviderApp/src/com/example/sample/provider/TemperatureResource.java
service/protocol-plugin/plugin-manager/src/Android/src/org/iotivity/service/ppm/FelixManager.java
service/protocol-plugin/plugin-manager/src/Android/src/org/iotivity/service/ppm/FoundResource.java
service/protocol-plugin/plugin-manager/src/Android/src/org/iotivity/service/ppm/MainActivity.java
service/protocol-plugin/plugin-manager/src/Android/src/org/iotivity/service/ppm/OnGetBelkinplug.java
service/protocol-plugin/plugin-manager/src/Android/src/org/iotivity/service/ppm/OnGetGear.java
service/protocol-plugin/plugin-manager/src/Android/src/org/iotivity/service/ppm/OnGetHuebulb.java
service/protocol-plugin/plugin-manager/src/Android/src/org/iotivity/service/ppm/OnPutBelkinplug.java
service/protocol-plugin/plugin-manager/src/Android/src/org/iotivity/service/ppm/OnPutGear.java
service/protocol-plugin/plugin-manager/src/Android/src/org/iotivity/service/ppm/OnPutHuebulb.java
service/protocol-plugin/plugin-manager/src/Android/src/org/iotivity/service/ppm/PluginManager.java
service/protocol-plugin/sample-app/tizen/PPMSampleApp/src/ppmsampleapp.cpp
service/soft-sensor-manager/SampleApp/android/SSMTesterApp/src/org/iotivity/service/ssm/sample/MainActivity.java
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/src/ssmtesterapp.cpp
service/things-manager/sampleapp/android/Sample/src/com/tm/sample/ActionListener.java
service/things-manager/sampleapp/android/Sample/src/com/tm/sample/ConfigurationApiActivity.java
service/things-manager/sampleapp/android/Sample/src/com/tm/sample/ConfigurationListener.java
service/things-manager/sampleapp/android/Sample/src/com/tm/sample/DiagnosticListener.java
service/things-manager/sampleapp/android/Sample/src/com/tm/sample/GroupApiActivity.java
service/things-manager/sampleapp/android/Sample/src/com/tm/sample/GroupClient.java
service/things-manager/sampleapp/android/Sample/src/com/tm/sample/MainActivity.java
service/things-manager/sampleapp/android/con-server/src/com/example/con_server/MainActivity.java
service/things-manager/sampleapp/tizen/ConServerApp/src/conserverapp.cpp
service/things-manager/sampleapp/tizen/ConServerApp/src/diagnosticsresource.cpp
service/things-manager/sampleapp/tizen/TMSampleApp/src/configuration.cpp
service/things-manager/sampleapp/tizen/TMSampleApp/src/group.cpp

index 796f771..219b622 100644 (file)
@@ -53,7 +53,7 @@ public class ResourceHosting extends Activity implements OnClickListener
         private final int OCSTACK_ERROR = 255;
         private final int RESOURCEHOSTING_DO_NOT_THREADRUNNING = -2;
 
-        private String TAG = "ResourceHosting";
+        private final String TAG = "NMResourceHosting : " + this.getClass().getSimpleName();
         private TextView mLogTextView;
         private String mLog = "";
         /**
@@ -151,6 +151,7 @@ public class ResourceHosting extends Activity implements OnClickListener
                     catch (Exception e)
                     {
                         Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
+                        Log.d(TAG, e.getMessage() + result);
                     }
                     break;
                 case R.id.btnStopHosting:
@@ -174,6 +175,7 @@ public class ResourceHosting extends Activity implements OnClickListener
         {
             mLog = "";
             mLogTextView.setText(mLog);
+            Log.i(TAG, "Log textbox is cleared");
         }
 
         /**
@@ -186,6 +188,7 @@ public class ResourceHosting extends Activity implements OnClickListener
         {
             mLog += msg + "\n";
             mLogTextView.setText(mLog);
+            Log.i(TAG, msg);
         }
 
         /**
index b24ab35..4005515 100644 (file)
@@ -56,7 +56,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
     OcPlatform.OnResourceFoundListener, OnGetListener, OnDeleteListener,
     OnObserveListener, OnPutListener
 {
-        private final String TAG = "sample_consumer";
+        private final String TAG = "NMConsumer : " + this.getClass().getSimpleName();
 
         public static final int OC_STACK_OK = 0;
         public static final String OBSERVE = "Observe";
@@ -169,6 +169,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
             OcPlatform.Configure(cfg);
             current_log_result += "Created Platform...\n";
             tv_current_log_result.setText(current_log_result);
+            Log.i(TAG, current_log_result);
             findResourceCandidate();
             PRINT();
         }
@@ -178,6 +179,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
             nmfindResource("", "/oc/core?rt=Resource.Hosting");
             current_log_result += "Finding Resource... \n";
             tv_current_log_result.setText(current_log_result);
+            Log.i(TAG, current_log_result);
         }
 
         public void nmfindResource(String host, String resourceName)
@@ -192,6 +194,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
                 e.printStackTrace();
                 current_log_result += e.getMessage() + "\n";
                 tv_current_log_result.setText(current_log_result);
+                Log.i(TAG, current_log_result);
             }
         }
 
@@ -204,6 +207,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
             {
                 current_log_result += "Getting Light Representation...\n";
                 tv_current_log_result.setText(current_log_result);
+                Log.i(TAG, current_log_result);
             }
         }
 
@@ -216,6 +220,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
             {
                 current_log_result += "Getting Light Representation...\n";
                 tv_current_log_result.setText(current_log_result);
+                Log.i(TAG, current_log_result);
 
                 try
                 {
@@ -227,6 +232,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
                     e.printStackTrace();
                     current_log_result += e.getMessage() + "\n";
                     tv_current_log_result.setText(current_log_result);
+                    Log.i(TAG, current_log_result);
                 }
             }
         }
@@ -248,6 +254,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
                 Map<String, String> queryParamsMap = new HashMap<String, String>();
                 current_log_result += "startObserve\n";
                 tv_current_log_result.setText(current_log_result);
+                Log.i(TAG, current_log_result);
 
                 try
                 {
@@ -258,6 +265,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
                     e.printStackTrace();
                     current_log_result += e.getMessage() + "\n";
                     tv_current_log_result.setText(current_log_result);
+                    Log.i(TAG, current_log_result);
                 }
             }
         }
@@ -269,6 +277,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
                 Map<String, String> queryParamsMap = new HashMap<String, String>();
                 current_log_result += "startGet\n";
                 tv_current_log_result.setText(current_log_result);
+                Log.i(TAG, current_log_result);
 
                 try
                 {
@@ -279,6 +288,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
                     e.printStackTrace();
                     current_log_result += e.getMessage() + "\n";
                     tv_current_log_result.setText(current_log_result);
+                    Log.i(TAG, current_log_result);
                 }
             }
         }
@@ -294,6 +304,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
                 Map<String, String> queryParamsMap = new HashMap<String, String>();
                 current_log_result += "startPut\n";
                 tv_current_log_result.setText(current_log_result);
+                Log.i(TAG, current_log_result);
 
                 try
                 {
@@ -304,6 +315,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
                     e.printStackTrace();
                     current_log_result += e.getMessage() + "\n";
                     tv_current_log_result.setText(current_log_result);
+                    Log.i(TAG, current_log_result);
                 }
             }
         }
@@ -324,16 +336,19 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
             {
                 case R.id.btn_observe:
                     tv_select_method_type.setText(OBSERVE);
+                    Log.i(TAG, "Method: " + OBSERVE);
                     startObserve(curResource);
                     btn_observe.setClickable(false);
                     break;
                 case R.id.btn_get:
                     tv_select_method_type.setText(GET);
+                    Log.i(TAG, "Method: " + GET);
                     startGet(curResource);
                     btn_get.setClickable(false);
                     break;
                 case R.id.btn_put:
                     tv_select_method_type.setText(PUT);
+                    Log.i(TAG, "Method: " + PUT);
                     startPut(curResource);
                     btn_put.setClickable(false);
                     break;
@@ -341,9 +356,11 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
                     tv_select_method_type.setText(POST);
                     Toast.makeText(this, "Not Supported Yet", Toast.LENGTH_SHORT)
                     .show();
+                    Log.i(TAG, "Method: " + POST);
                     break;
                 case R.id.btn_delete:
                     tv_select_method_type.setText(DELETE);
+                    Log.i(TAG, "Method: " + DELETE);
                 try {
                     startDelete(curResource);
                 } catch (OcException e) {
@@ -354,6 +371,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
                     break;
                 case R.id.btn_clean:
                     cleanLogString();
+                    Log.i(TAG, "Log textbox is cleared");
                     break;
 
                 default:
@@ -376,14 +394,17 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
                     if (receive_result != null)
                     {
                         tv_receive_result.setText(receive_result);
+                        Log.i(TAG, "Received: " + receive_result);
                     }
                     if (found_uri != null)
                     {
                         tv_found_uri.setText(found_uri);
+                        Log.i(TAG, "URI: " + found_uri);
                     }
                     if (current_log_result != null)
                     {
                         tv_current_log_result.setText(current_log_result);
+                        Log.i(TAG, current_log_result);
                     }
 
                 }
@@ -475,6 +496,7 @@ public class SampleConsumer extends Activity implements View.OnClickListener,
                     final String message = intent
                                            .getStringExtra(MESSAGE);
                     tv_current_log_result.setText(message);
+                    Log.i(TAG, message);
                     viewText();
                 }
         }
index 8ed682a..48c45da 100644 (file)
@@ -47,7 +47,7 @@ import android.widget.TextView;
 public class SampleProvider extends Activity implements OnClickListener,
     IMessageLogger
 {
-        private final static String TAG = "SampleProvider : ";
+        private final static String TAG = "NMProvider : SampleProvider";
         private TextView mLogTextView;
         private TextView mTempValue;
         private TextView mHumValue;
@@ -253,6 +253,7 @@ public class SampleProvider extends Activity implements OnClickListener,
                     break;
                 case R.id.btnLogClear:
                     mLogTextView.setText("");
+                    Log.i(TAG, "Log message cleared");
                     break;
             }
 
index 2cae1e9..e72c54b 100644 (file)
@@ -30,7 +30,7 @@ public class TemperatureResource implements IMessageLogger
         private OcResourceHandle mResourceHandle;
         private List<Byte> mObservationIds;
 
-        private static String TAG = "SampleProvider : ";
+        private static String TAG = "NMProvider : TemperatureResource";
 
         TemperatureResource(Context context)
         {
@@ -115,7 +115,7 @@ public class TemperatureResource implements IMessageLogger
             {
                 Log.e(TAG, "go exception");
                 logMessage(TAG + "RegisterResource error. " + e.getMessage());
-                Log.e(TAG, e.getMessage());
+                Log.e(TAG, "RegisterResource error. " + e.getMessage());
             }
 
             // logMessage(TAG + "Successfully registered resource");
@@ -243,6 +243,7 @@ public class TemperatureResource implements IMessageLogger
         public void logMessage(String msg)
         {
             logMsg(msg);
+            Log.i(TAG, msg);
         }
 
         public void logMsg(final String text)
index 0822c09..f841e64 100644 (file)
@@ -50,6 +50,7 @@ public class FelixManager {
     private static Context                 m_context;
     private static final int               TRUE                       = 1;
     private static final int               FALSE                      = 0;
+    private static final String            LOG_TAG                    = "PPMSampleApp : FelixManager";
 
     static final String                    ANDROID_FRAMEWORK_PACKAGES = ("android,"
                                                                   + "android.app,"
@@ -101,7 +102,7 @@ public class FelixManager {
     }
 
     public static void LogEx(String info) {
-        Log.d("felix", info);
+        Log.d(LOG_TAG, info);
     }
 
     private FelixManager(Context ctx) {
@@ -129,7 +130,7 @@ public class FelixManager {
                 LogEx("Bundle: " + b.getSymbolicName());
             }
         } catch (Throwable ex) {
-            Log.d("Felix", "could not create framework: " + ex.getMessage(), ex);
+            Log.d(LOG_TAG, "could not create framework: " + ex.getMessage(), ex);
         }
     }
 
@@ -162,10 +163,10 @@ public class FelixManager {
             org.osgi.framework.Bundle[] bundles = bContext.getBundles();
             for (org.osgi.framework.Bundle b : bundles) {
                 if (b.getSymbolicName().equals(id)) {
-                    Log.d("Felix", "bundle: " + b.getBundleId()
+                    Log.d(LOG_TAG, "bundle: " + b.getBundleId()
                             + "   symbolicName : " + b.getSymbolicName());
                     b.uninstall();
-                    Log.d("Felix", "uninstall end");
+                    Log.d(LOG_TAG, "uninstall end");
                 }
             }
         } catch (BundleException e) {
@@ -183,10 +184,10 @@ public class FelixManager {
             org.osgi.framework.Bundle[] bundles = bContext.getBundles();
             for (org.osgi.framework.Bundle b : bundles) {
                 if (!b.getSymbolicName().equals("org.apache.felix.framework")) {
-                    Log.d("Felix", "bundle: " + b.getBundleId()
+                    Log.d(LOG_TAG, "bundle: " + b.getBundleId()
                             + "   symbolicName : " + b.getSymbolicName());
                     b.uninstall();
-                    Log.d("Felix", "uninstall end");
+                    Log.d(LOG_TAG, "uninstall end");
                 }
             }
         } catch (BundleException e) {
@@ -230,19 +231,19 @@ public class FelixManager {
 
     public static int start(String id) {
         int flag = TRUE;
-        Log.d("Felix", "String id : " + id);
+        Log.d(LOG_TAG, "String id : " + id);
         try {
             BundleContext bContext = m_felix.getBundleContext();
             bContext.registerService(Context.class.getName(), m_context, null);
 
             org.osgi.framework.Bundle[] bundles = bContext.getBundles();
             for (org.osgi.framework.Bundle b : bundles) {
-                Log.d("Felix", "symbolicName : " + b.getSymbolicName());
+                Log.d(LOG_TAG, "symbolicName : " + b.getSymbolicName());
                 if (b.getSymbolicName().equals(id)) {
-                    Log.d("Felix", "bundle: " + b.getBundleId()
+                    Log.d(LOG_TAG, "bundle: " + b.getBundleId()
                             + "   symbolicName : " + b.getSymbolicName());
                     b.start();
-                    Log.d("Felix", "start end");
+                    Log.d(LOG_TAG, "start end");
                 }
             }
         } catch (BundleException e) {
@@ -259,10 +260,10 @@ public class FelixManager {
             org.osgi.framework.Bundle[] bundles = bContext.getBundles();
             for (org.osgi.framework.Bundle b : bundles) {
                 if (b.getSymbolicName().equals(id)) {
-                    Log.d("Felix", "bundle: " + b.getBundleId()
+                    Log.d(LOG_TAG, "bundle: " + b.getBundleId()
                             + "   symbolicName : " + b.getSymbolicName());
                     b.stop();
-                    Log.d("Felix", "stop end");
+                    Log.d(LOG_TAG, "stop end");
                 }
             }
         } catch (BundleException e) {
@@ -280,20 +281,20 @@ public class FelixManager {
     }
 
     public static String getValue(String name, String key) {
-        Log.d("FELIX", "getValue");
+        Log.d(LOG_TAG, "getValue");
         BundleContext bContext = m_felix.getBundleContext();
         org.osgi.framework.Bundle[] bundles = bContext.getBundles();
         for (org.osgi.framework.Bundle b : bundles) {
             Dictionary<String, String> dic = b.getHeaders();
             String bundlename = b.getSymbolicName();
-            Log.d("FELIX", "Bundlename: " + bundlename);
+            Log.d(LOG_TAG, "Bundlename: " + bundlename);
 
             if (bundlename.equals(name)) {
                 if (dic.get("Bundle-" + key) == null) {
-                    Log.d("FELIX", name + " null");
+                    Log.d(LOG_TAG, name + " null");
                     return "";
                 }
-                Log.d("FELIX", name + " " + dic.get("Bundle-" + key));
+                Log.d(LOG_TAG, name + " " + dic.get("Bundle-" + key));
                 return dic.get("Bundle-" + key);
             }
         }
@@ -301,7 +302,7 @@ public class FelixManager {
     }
 
     public static String getState(String name) {
-        Log.d("FELIX", "getState");
+        Log.d(LOG_TAG, "getState");
         BundleContext bContext = m_felix.getBundleContext();
         org.osgi.framework.Bundle[] bundles = bContext.getBundles();
         for (org.osgi.framework.Bundle b : bundles) {
@@ -309,11 +310,11 @@ public class FelixManager {
             String bundlename = b.getSymbolicName();
 
             if (bundlename.equals(name)) {
-                Log.d("FELIX", state_to_string(b.getState()));
+                Log.d(LOG_TAG, state_to_string(b.getState()));
                 return state_to_string(b.getState());
             }
         }
-        Log.d("FELIX", "null");
+        Log.d(LOG_TAG, "null");
         return "";
     }
 
@@ -451,13 +452,13 @@ public class FelixManager {
 
     public static int ObservePluginPath(String path) {
         int flag = TRUE;
-        Log.d("FELIX", "ObservePluginPath" + path);
+        Log.d(LOG_TAG, "ObservePluginPath" + path);
 
         FileObserver observer = new FileObserver(path) {
             @Override
             public void onEvent(int event, String path) {
-                Log.d("FELIX", "Observing start : " + path);
-                Log.d("FELIX", "Observing event : " + getEventString(event));
+                Log.d(LOG_TAG, "Observing start : " + path);
+                Log.d(LOG_TAG, "Observing event : " + getEventString(event));
             }
         };
         observer.startWatching();
@@ -470,7 +471,7 @@ public class FelixManager {
         int flag = TRUE;
         if (path == "") {
             System.out.println("PluginManager path is Null\n");
-            Log.d("FELIX", "PluginManager path is Null\n");
+            Log.d(LOG_TAG, "PluginManager path is Null\n");
             flag = FALSE;
             return flag;
         }
@@ -534,7 +535,7 @@ public class FelixManager {
             } else {
                 String fullPath = "/data/data/"
                         + m_context.getPackageName() + "/" + path;
-                Log.d("FELIX", fullPath);
+                Log.d(LOG_TAG, fullPath);
                 File dir = new File(fullPath);
 
                 if (!dir.exists())
@@ -544,7 +545,7 @@ public class FelixManager {
                 }
             }
         } catch (IOException ex) {
-            Log.e("tag", "I/O Exception", ex);
+            Log.e(LOG_TAG, "I/O Exception", ex);
         }
     }
 
@@ -571,7 +572,7 @@ public class FelixManager {
             out.close();
             out = null;
         } catch (Exception e) {
-            Log.e("tag", e.getMessage());
+            Log.e(LOG_TAG, e.getMessage());
         }
     }
 }
\ No newline at end of file
index 1fa7ef5..9965832 100644 (file)
@@ -31,7 +31,7 @@ import org.iotivity.base.OcResource;
 import android.util.Log;
 
 public class FoundResource implements OcPlatform.OnResourceFoundListener {
-    final private static String TAG = "FoundResource";
+    final private static String TAG = "PPMSampleApp : FoundResource";
 
     public void onResourceFound(OcResource resource) {
 
index 8a866d8..35f281b 100644 (file)
@@ -68,6 +68,7 @@ public class MainActivity extends Activity implements
     static ToggleButton                Hue;
     static android.widget.NumberPicker hue_color;
     static Activity                    mActivity;
+    final private static String LOG_TAG = "PPMSampleApp : MainActivity";
 
     PluginManager                      m_pm;
 
@@ -101,6 +102,7 @@ public class MainActivity extends Activity implements
     Map<Integer, Integer>              onValueChangefinalVal    = new HashMap<Integer, Integer>();
     Map<Integer, Boolean>              onValueChangeThreadStart = new HashMap<Integer, Boolean>();
     String[]                           np_h                     = new String[11];
+    
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -140,29 +142,29 @@ public class MainActivity extends Activity implements
             OcPlatform.findResource("", OcPlatform.WELL_KNOWN_QUERY,
                     OcConnectivityType.ALL, foundResource);
         } catch (Exception e) {
-            Log.e("Felix", "Exception : " + e);
+            Log.e(LOG_TAG, "Exception : " + e);
         }
 
         Belkin = (Button) findViewById(R.id.btn_belkin);
         Belkin.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "Belkin button click listener");
+                Log.i(LOG_TAG, "Belkin button click listener");
                 OcRepresentation rep = new OcRepresentation();
                 try {
                     if (belkinplug.m_power == null) {
-                        Log.i("Felix", "m_power is null");
+                        Log.i(LOG_TAG, "m_power is null");
                         belkinplug.m_power = "on";
                         rep.setValue("power", "on");
                     }
                     if (belkinplug.m_power.equals("on")) {
                         Toast.makeText(getApplicationContext(), "Off",
                                 Toast.LENGTH_SHORT).show();
-                        Log.i("Felix", "belkin wemo off");
+                        Log.i(LOG_TAG, "belkin wemo off");
                         rep.setValue("power", "off");
                     } else if (belkinplug.m_power.equals("off")) {
                         Toast.makeText(getApplicationContext(), "On",
                                 Toast.LENGTH_SHORT).show();
-                        Log.i("Felix", "belkin wemo on");
+                        Log.i(LOG_TAG, "belkin wemo on");
                         rep.setValue("power", "on");
                     } else {
                         rep.setValue("power", "on");
@@ -172,7 +174,7 @@ public class MainActivity extends Activity implements
                     rep.setValue("brightness", 0);
                     rep.setValue("color", 0);
                 } catch (OcException e) {
-                    Log.e("Felix", e.getMessage());
+                    Log.e(LOG_TAG, e.getMessage());
                 }
                 OnPutBelkinplug onPut = new OnPutBelkinplug();
                 if (belkinResource != null) {
@@ -185,6 +187,7 @@ public class MainActivity extends Activity implements
                 } else {
                     Toast.makeText(getApplicationContext(), "Belkinplug null",
                             Toast.LENGTH_SHORT).show();
+                    Log.i(LOG_TAG, "Belkinplug null");
                 }
             }
         });
@@ -192,14 +195,14 @@ public class MainActivity extends Activity implements
         belkinstart = (Button) findViewById(R.id.Button01);
         belkinstart.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "start button click listener");
+                Log.i(LOG_TAG, "start button click listener");
                 m_pm.startPlugins("ResourceType", "device.smartplug");
 
                 Handler handler = new Handler();
                 handler.postDelayed(new Runnable() {
                     @Override
                     public void run() {
-                        Log.i("Felix", "run called!!!");
+                        Log.i(LOG_TAG, "run called!!!");
                         FoundResource foundResource = new FoundResource();
                         try {
                             OcPlatform
@@ -217,7 +220,7 @@ public class MainActivity extends Activity implements
         belkinstop = (Button) findViewById(R.id.Button02);
         belkinstop.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "stop button click listener");
+                Log.i(LOG_TAG, "stop button click listener");
                 m_pm.stopPlugins("ResourceType", "device.smartplug");
                 belkinResource = null;
                 try {
@@ -231,7 +234,7 @@ public class MainActivity extends Activity implements
         belkingetPlugins = (Button) findViewById(R.id.Button03);
         belkingetPlugins.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "getPlugins button click listener");
+                Log.i(LOG_TAG, "getPlugins button click listener");
                 user_plugin = m_pm.getPlugins();
                 // key = "name";
                 state = "";
@@ -248,7 +251,7 @@ public class MainActivity extends Activity implements
         belkingetPlugins = (Button) findViewById(R.id.Button04);
         belkingetPlugins.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "getState click listener");
+                Log.i(LOG_TAG, "getState click listener");
                 state = m_pm.getState("wemo");
                 if (state == "")
                     state = "null";
@@ -264,7 +267,7 @@ public class MainActivity extends Activity implements
         belkinrescan = (Button) findViewById(R.id.Button05);
         belkinrescan.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "Rescan Plugin click listener");
+                Log.i(LOG_TAG, "Rescan Plugin click listener");
                 m_pm.rescanPlugin();
                 try {
                     Thread.sleep(2000);
@@ -277,7 +280,7 @@ public class MainActivity extends Activity implements
         Gear = (Button) findViewById(R.id.btn_gear);
         Gear.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "Gear button click listener");
+                Log.i(LOG_TAG, "Gear button click listener");
                 OcRepresentation rep = new OcRepresentation();
                 
                 try{   
@@ -287,12 +290,13 @@ public class MainActivity extends Activity implements
                     rep.setValue("brightness", 0);
                     rep.setValue("color", 0);
                 } catch (OcException e) {
-                    Log.e("Felix", e.getMessage());
+                    Log.e(LOG_TAG, e.getMessage());
                 }
                 
                 if (gearResource != null) {
                     Toast.makeText(getApplicationContext(),
                             "Send Noti. to Gear", Toast.LENGTH_SHORT).show();
+                    Log.i(LOG_TAG, "Send Noti. to Gear");
                     try {
                         OnPutGear onPut = new OnPutGear();
                         gearResource.put(rep, new HashMap<String, String>(),
@@ -303,6 +307,7 @@ public class MainActivity extends Activity implements
                 } else {
                     Toast.makeText(getApplicationContext(), "Gear is null",
                             Toast.LENGTH_SHORT).show();
+                    Log.i(LOG_TAG, "Gear is null");
                 }
             }
         });
@@ -310,14 +315,14 @@ public class MainActivity extends Activity implements
         gearstart = (Button) findViewById(R.id.Button06);
         gearstart.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "start button click listener");
+                Log.i(LOG_TAG, "start button click listener");
                 m_pm.startPlugins("ResourceType", "device.notify");
 
                 Handler handler = new Handler();
                 handler.postDelayed(new Runnable() {
                     @Override
                     public void run() {
-                        Log.i("Felix", "run called!!!");
+                        Log.i(LOG_TAG, "run called!!!");
                         FoundResource foundResource = new FoundResource();
                         try {
                             OcPlatform
@@ -335,7 +340,7 @@ public class MainActivity extends Activity implements
         gearstop = (Button) findViewById(R.id.Button07);
         gearstop.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "stop button click listener");
+                Log.i(LOG_TAG, "stop button click listener");
                 m_pm.stopPlugins("ResourceType", "device.notify");
                 gearResource = null;
                 try {
@@ -349,7 +354,7 @@ public class MainActivity extends Activity implements
         geargetPlugins = (Button) findViewById(R.id.Button08);
         geargetPlugins.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "getPlugins button click listener");
+                Log.i(LOG_TAG, "getPlugins button click listener");
                 user_plugin = m_pm.getPlugins();
                 state = "";
                 id = "";
@@ -365,7 +370,7 @@ public class MainActivity extends Activity implements
         geargetPlugins = (Button) findViewById(R.id.Button09);
         geargetPlugins.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "getState click listener");
+                Log.i(LOG_TAG, "getState click listener");
                 state = m_pm.getState("gearnoti");
                 if (state == "")
                     state = "null";
@@ -381,7 +386,7 @@ public class MainActivity extends Activity implements
         gearrescan = (Button) findViewById(R.id.Button10);
         gearrescan.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "Rescan Plugin click listener");
+                Log.i(LOG_TAG, "Rescan Plugin click listener");
                 m_pm.rescanPlugin();
                 try {
                     Thread.sleep(2000);
@@ -394,14 +399,15 @@ public class MainActivity extends Activity implements
         Hue = (ToggleButton) findViewById(R.id.tbtn_hue_power);
         Hue.setOnClickListener(new ToggleButton.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "Hue button click listener");
+                Log.i(LOG_TAG, "Hue button click listener");
                 OcRepresentation rep = new OcRepresentation();
                 ToggleButton t = (ToggleButton) v;
                 if (t.isChecked()) {
                     Toast.makeText(getApplicationContext(), "Hue ON",
                             Toast.LENGTH_SHORT).show();
+                    Log.i(LOG_TAG, "Hue ON");
                     if (hueplug.m_bright == 0) {
-                        Log.e("Felix", "hueplug m_bright is 0");
+                        Log.e(LOG_TAG, "hueplug m_bright is 0");
                         hueplug.m_bright = 128;
                     }
                     try {
@@ -411,7 +417,7 @@ public class MainActivity extends Activity implements
                         rep.setValue("brightness", hueplug.m_bright);
                         rep.setValue("color", hueplug.m_color);
                     } catch (OcException e) {
-                        Log.e("Felix", e.getMessage());
+                        Log.e(LOG_TAG, e.getMessage());
                     }
 
                     OnPutHuebulb onPut = new OnPutHuebulb();
@@ -425,12 +431,14 @@ public class MainActivity extends Activity implements
                     } else {
                         Toast.makeText(getApplicationContext(),
                                 "HueResource null", Toast.LENGTH_SHORT).show();
+                        Log.i(LOG_TAG, "HueResource null");
                     }
                 } else {
                     Toast.makeText(getApplicationContext(), "Hue OFF",
                             Toast.LENGTH_SHORT).show();
+                    Log.i(LOG_TAG, "Hue OFF");
                     if (hueplug.m_bright == 0) {
-                        Log.e("Felix", "hueplug m_bright is 0");
+                        Log.e(LOG_TAG, "hueplug m_bright is 0");
                         hueplug.m_bright = 128;
                     }
                     try {
@@ -440,7 +448,7 @@ public class MainActivity extends Activity implements
                         rep.setValue("brightness", hueplug.m_bright);
                         rep.setValue("color", hueplug.m_color);
                     } catch (OcException e) {
-                        Log.e("Felix", e.getMessage());
+                        Log.e(LOG_TAG, e.getMessage());
                     }
 
                     OnPutHuebulb onPut = new OnPutHuebulb();
@@ -451,10 +459,12 @@ public class MainActivity extends Activity implements
                                     onPut);
                         } catch (OcException e) {
                             e.printStackTrace();
+                            Log.e(LOG_TAG, e.getMessage());
                         }
                     } else {
                         Toast.makeText(getApplicationContext(),
                                 "HueResource null", Toast.LENGTH_SHORT).show();
+                        Log.i(LOG_TAG, "HueResource null");
                     }
                 }
             }
@@ -463,14 +473,14 @@ public class MainActivity extends Activity implements
         huestart = (Button) findViewById(R.id.Button11);
         huestart.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "start button click listener");
+                Log.i(LOG_TAG, "start button click listener");
                 m_pm.startPlugins("ResourceType", "device.light");
 
                 Handler handler = new Handler();
                 handler.postDelayed(new Runnable() {
                     @Override
                     public void run() {
-                        Log.i("Felix", "run called!!!");
+                        Log.i(LOG_TAG, "run called!!!");
                         FoundResource foundResource = new FoundResource();
                         try {
                             OcPlatform
@@ -488,7 +498,7 @@ public class MainActivity extends Activity implements
         huestop = (Button) findViewById(R.id.Button12);
         huestop.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "stop button click listener");
+                Log.i(LOG_TAG, "stop button click listener");
                 m_pm.stopPlugins("ResourceType", "device.light");
                 hueResource = null;
                 try {
@@ -502,7 +512,7 @@ public class MainActivity extends Activity implements
         huegetPlugins = (Button) findViewById(R.id.Button13);
         huegetPlugins.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "getPlugins button click listener");
+                Log.i(LOG_TAG, "getPlugins button click listener");
                 user_plugin = m_pm.getPlugins();
                 key = "name";
                 state = "";
@@ -519,7 +529,7 @@ public class MainActivity extends Activity implements
         huegetPlugins = (Button) findViewById(R.id.Button14);
         huegetPlugins.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "getState click listener");
+                Log.i(LOG_TAG, "getState click listener");
                 state = m_pm.getState("hue");
                 if (state == "")
                     state = "null";
@@ -535,7 +545,7 @@ public class MainActivity extends Activity implements
         huerescan = (Button) findViewById(R.id.Button15);
         huerescan.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
-                Log.i("Felix", "Rescan Plugin click listener");
+                Log.i(LOG_TAG, "Rescan Plugin click listener");
                 m_pm.rescanPlugin();
                 try {
                     Thread.sleep(2000);
@@ -549,33 +559,39 @@ public class MainActivity extends Activity implements
     static public void updateConnectStatus(String device, boolean status) {
         if (device.equals("belkinplug")) {
             if (status) {
-                Log.i("Felix", "belkingplug status green");
+                Log.i(LOG_TAG, "belkingplug status green");
                 Toast.makeText(mActivity.getApplicationContext(),
                         "Belkin Connected", Toast.LENGTH_SHORT).show();
+                Log.i(LOG_TAG, "Belkin Connected");
             } else {
-                Log.i("Felix", "belkingplug status gray");
+                Log.i(LOG_TAG, "belkingplug status gray");
                 Toast.makeText(mActivity.getApplicationContext(),
                         "Belkin Disonnected", Toast.LENGTH_SHORT).show();
+                Log.i(LOG_TAG, "Belkin Disonnected");
             }
         } else if (device.equals("gear")) {
             if (status) {
-                Log.i("Felix", "gear status green");
+                Log.i(LOG_TAG, "gear status green");
                 Toast.makeText(mActivity.getApplicationContext(),
                         "Gear Connected", Toast.LENGTH_SHORT).show();
+                Log.i(LOG_TAG, "Gear Connected");
             } else {
-                Log.i("Felix", "gear status gray");
+                Log.i(LOG_TAG, "gear status gray");
                 Toast.makeText(mActivity.getApplicationContext(),
                         "Gear Disconnected", Toast.LENGTH_SHORT).show();
+                Log.i(LOG_TAG, "Gear Disonnected");
             }
         } else if (device.equals("huebulb")) {
             if (status) {
-                Log.i("Felix", "huebulb status green");
+                Log.i(LOG_TAG, "huebulb status green");
                 Toast.makeText(mActivity.getApplicationContext(),
                         "Hue Connected", Toast.LENGTH_SHORT).show();
+                Log.i(LOG_TAG, "Hue Connected");
             } else {
-                Log.i("Felix", "huebulb status gray");
+                Log.i(LOG_TAG, "huebulb status gray");
                 Toast.makeText(mActivity.getApplicationContext(),
                         "Hue Disconnected", Toast.LENGTH_SHORT).show();
+                Log.i(LOG_TAG, "Hue Disconnected");
             }
 
             if (hueplug.m_power.equals("on")) {
@@ -600,26 +616,26 @@ public class MainActivity extends Activity implements
 
     @Override
     protected void onResume() {
-        Log.i("Felix", "onResume()");
+        Log.i(LOG_TAG, "onResume()");
         super.onResume();
     }
 
     @Override
     protected void onPause() {
-        Log.i("Felix", "onPause()");
+        Log.i(LOG_TAG, "onPause()");
         super.onPause();
         finish();
     }
 
     @Override
     protected void onStop() {
-        Log.i("Felix", "onStop()");
+        Log.i(LOG_TAG, "onStop()");
         super.onStop();
     }
 
     @Override
     protected void onDestroy() {
-        Log.i("Felix", "onDestroy()");
+        Log.i(LOG_TAG, "onDestroy()");
         System.exit(1);
         super.onDestroy();
     }
@@ -636,14 +652,14 @@ public class MainActivity extends Activity implements
             try {
                 sleep(1000, 0);
             } catch (Exception e) {
-                Log.i("Felix", "waitForFinal exception : " + e);
+                Log.i(LOG_TAG, "waitForFinal exception : " + e);
             }
-            Log.i("Felix", "Final Value for NUMBERPICKER[" + idx + "] : "
+            Log.i(LOG_TAG, "Final Value for NUMBERPICKER[" + idx + "] : "
                     + onValueChangefinalVal.get(idx));
 
             if (idx == R.id.np_hue_color) {
                 hueplug.m_color = 6300 * onValueChangefinalVal.get(idx);
-                Log.i("Felix", "m_color = " + hueplug.m_color);
+                Log.i(LOG_TAG, "m_color = " + hueplug.m_color);
 
                 OcRepresentation rep = new OcRepresentation();
                 if (hueplug.m_power == null) {
@@ -659,12 +675,12 @@ public class MainActivity extends Activity implements
                     rep.setValue("brightness", hueplug.m_bright = 180);
                     rep.setValue("color", hueplug.m_color);
                 } catch (OcException e) {
-                    Log.e("Felix", e.getMessage());
+                    Log.e(LOG_TAG, e.getMessage());
                 }
 
                 OnPutHuebulb onPut = new OnPutHuebulb();
                 if (hueResource != null) {
-                    Log.i("Felix", "huebulbResource is not null");
+                    Log.i(LOG_TAG, "huebulbResource is not null");
                     try {
                         hueResource.put(rep, new HashMap<String, String>(),
                                 onPut);
@@ -672,7 +688,7 @@ public class MainActivity extends Activity implements
                         e.printStackTrace();
                     }
                 } else {
-                    Log.i("Felix", "huebulbResource is null");
+                    Log.i(LOG_TAG, "huebulbResource is null");
                 }
             }
             onValueChangeThreadStart.put(idx, false);
index 3e58264..2308405 100644 (file)
@@ -35,7 +35,7 @@ import org.iotivity.base.OcResource;
 import android.util.Log;
 
 public class OnGetBelkinplug implements OcResource.OnGetListener {
-    final private static String TAG = "OnGetBelkinplug";
+    final private static String TAG = "PPMSampleApp : OnGetBelkinplug";
 
     @Override
     public void onGetCompleted(List<OcHeaderOption> headerOptions,
index 309f1d6..136199c 100644 (file)
@@ -35,7 +35,7 @@ import org.iotivity.base.OcResource;
 import android.util.Log;
 
 public class OnGetGear implements OcResource.OnGetListener {
-    final private static String TAG = "OnGetGear";
+    final private static String TAG = "PPMSampleApp : OnGetGear";
 
     @Override
     public void onGetCompleted(List<OcHeaderOption> headerOptions,
index dfb89f0..2404882 100644 (file)
@@ -35,7 +35,7 @@ import org.iotivity.base.OcResource;
 import android.util.Log;
 
 public class OnGetHuebulb implements OcResource.OnGetListener {
-    final private static String TAG = "OnGetHuebulb";
+    final private static String TAG = "PPMSampleApp : OnGetHuebulb";
 
     @Override
     public void onGetCompleted(List<OcHeaderOption> headerOptions,
index c949ca9..079638a 100644 (file)
@@ -35,7 +35,7 @@ import org.iotivity.base.OcResource;
 import android.util.Log;
 
 public class OnPutBelkinplug implements OcResource.OnPutListener {
-    final private static String TAG = "OnPutBelkinplug";
+    final private static String TAG = "PPMSampleApp : OnPutBelkinplug";
 
     @Override
     public void onPutCompleted(List<OcHeaderOption> options,
index 081247f..1d789cd 100644 (file)
@@ -35,7 +35,7 @@ import org.iotivity.base.OcResource;
 import android.util.Log;
 
 public class OnPutGear implements OcResource.OnPutListener {
-    final private static String TAG = "OnPutGear";
+    final private static String TAG = "PPMSampleApp : OnPutGear";
 
     @Override
     public void onPutCompleted(List<OcHeaderOption> options,
index defd511..1fb1870 100644 (file)
@@ -35,7 +35,7 @@ import org.iotivity.base.OcResource;
 import android.util.Log;
 
 public class OnPutHuebulb implements OcResource.OnPutListener {
-    final private static String TAG = "OnPutHuebulb";
+    final private static String TAG = "PPMSampleApp : OnPutHuebulb";
 
     @Override
     public void onPutCompleted(List<OcHeaderOption> options,
index ad875d9..13f1374 100644 (file)
@@ -92,6 +92,8 @@ public class PluginManager {
         System.loadLibrary("PluginManager");
     }
 
+    private static final String LOG_TAG = "PPMSampleApp : PluginManager";
+
     private native int jniStartPlugins(String key, String value);
 
     private native int jniStopPlugins(String key, String value);
@@ -103,6 +105,6 @@ public class PluginManager {
     private native String jniGetState(String plugID);
 
     private static void LogEx(String info) {
-        Log.d("PluginManager.java", info);
+        Log.d(LOG_TAG, info);
     }
 }
index 54f9b03..47cb8ee 100644 (file)
@@ -127,6 +127,7 @@ void onObserve(const HeaderOptions headerOptions, const OCRepresentation &rep,
         sprintf(buf, "name: = %s<br>", myfan.m_name.c_str());
         strcat(temp_string, buf);
         m_ThreadContext.log = temp_string;
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
 
@@ -147,6 +148,7 @@ void onObserve(const HeaderOptions headerOptions, const OCRepresentation &rep,
         sprintf(buf, "onObserve Response error:  = %d<br>", eCode);
         strcpy(temp_string, buf);
         m_ThreadContext.log = temp_string;
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
         std::exit(-1);
@@ -182,6 +184,7 @@ void onPost2(const HeaderOptions &headerOptions, const OCRepresentation &rep, co
             sprintf(buf, "name: = %s<br>", myfan.m_name.c_str());
             strcat(temp_string, buf);
             m_ThreadContext.log = temp_string;
+            dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
             ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                                   &m_ThreadContext);
         }
@@ -200,6 +203,7 @@ void onPost2(const HeaderOptions &headerOptions, const OCRepresentation &rep, co
         sprintf(buf, "onPost Response error:  = %d<br>", eCode);
         strcpy(temp_string, buf);
         m_ThreadContext.log = temp_string;
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
         std::exit(-1);
@@ -235,6 +239,7 @@ void onPost(const HeaderOptions &headerOptions, const OCRepresentation &rep, con
             sprintf(buf, "name: = %s<br>", myfan.m_name.c_str());
             strcat(temp_string, buf);
             m_ThreadContext.log = temp_string;
+            dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
             ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                                   &m_ThreadContext);
         }
@@ -257,6 +262,7 @@ void onPost(const HeaderOptions &headerOptions, const OCRepresentation &rep, con
         sprintf(buf, "onPost Response error:  = %d<br>", eCode);
         strcpy(temp_string, buf);
         m_ThreadContext.log = temp_string;
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
         std::exit(-1);
@@ -306,6 +312,7 @@ void onPut(const HeaderOptions &headerOptions, const OCRepresentation &rep, cons
         sprintf(buf, "name: = %s<br>", myfan.m_name.c_str());
         strcat(temp_string, buf);
         m_ThreadContext.log = temp_string;
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
 
@@ -317,6 +324,7 @@ void onPut(const HeaderOptions &headerOptions, const OCRepresentation &rep, cons
         sprintf(buf, "onPut Response error:  = %d<br>", eCode);
         strcpy(temp_string, buf);
         m_ThreadContext.log = temp_string;
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
         std::exit(-1);
@@ -370,6 +378,7 @@ void onFanGet(const HeaderOptions &headerOptions, const OCRepresentation &rep, c
         sprintf(buf, "name: = %s<br>", myfan.m_name.c_str());
         strcat(temp_string, buf);
         m_ThreadContext.log = temp_string;
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
 
@@ -381,6 +390,7 @@ void onFanGet(const HeaderOptions &headerOptions, const OCRepresentation &rep, c
         sprintf(buf, "onGET Response error:  = %d<br>", eCode);
         strcpy(temp_string, buf);
         m_ThreadContext.log = temp_string;
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                               &m_ThreadContext);
         std::exit(-1);
@@ -458,6 +468,7 @@ void foundResourceFan(std::shared_ptr<OCResource> resource)
                 putFanRepresentation(curFanResource);
             }
             m_ThreadContext.log = temp_string;
+            dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
             ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                                   &m_ThreadContext);
         }
@@ -467,6 +478,7 @@ void foundResourceFan(std::shared_ptr<OCResource> resource)
             std::cout << "Resource is invalid" << std::endl;
             strcpy(temp_string, "Resource is invalid");
             m_ThreadContext.log = temp_string;
+            dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
             ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                                   &m_ThreadContext);
         }
@@ -521,6 +533,7 @@ send_msg_clicked_cb(void *data , Evas_Object *obj , void *event_info)
                 sprintf(buf, "value ID = %s<br>", user_plugin[i].getID().c_str());
                 strcat(temp_string, buf);
                 m_ThreadContext.log = temp_string;
+                dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
                 ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                                       &m_ThreadContext);
                 std::cout << "value Name = " << user_plugin[i].getName() << std::endl;
@@ -532,6 +545,7 @@ send_msg_clicked_cb(void *data , Evas_Object *obj , void *event_info)
             strcpy(temp_string, "start fan Plugin<br>");
             strcat(temp_string, "fan Plugin is getting started. Please wait...<br>");
             m_ThreadContext.log = temp_string;
+            dlog_print(DLOG_INFO, LOG_TAG, " %s", m_ThreadContext.log);
             ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateCallbackLog,
                                                   &m_ThreadContext);
             m_pm->startPlugins("ResourceType", "oic.fan");
index 7a4c12d..b092fd9 100644 (file)
@@ -45,7 +45,7 @@ public class MainActivity extends Activity {
     private ArrayList<Integer> mRunningQueries           = new ArrayList<Integer>();
 
     private IQueryEngineEvent  mQueryEngineEventListener = null;
-    private final String         LOG_TAG = this.getClass().getSimpleName();
+    private final String         LOG_TAG = "SSMSampleApp : " + this.getClass().getSimpleName();
     private static MainActivity  activityObj;
 
     void PrintLog(String log) {
@@ -54,6 +54,7 @@ public class MainActivity extends Activity {
         data.putString("Log", log);
         msg.setData(data);
         logHandler.sendMessage(msg);
+        Log.i(LOG_TAG, log);
     }
 
     private Handler      logHandler         = new Handler() {
@@ -203,18 +204,22 @@ public class MainActivity extends Activity {
                 switch (v.getId()) {
                     case R.id.btClear:
                         edtQuery.setText("");
+                        Log.i(LOG_TAG, "Query textbox is cleared");
                         break;
 
                     case R.id.btLogClear:
                         tvLog.setText("");
+                        Log.i(LOG_TAG, "Log textbox is cleared");
                         break;
 
                     case R.id.btFullDevice:
                         edtQuery.setText("subscribe Device if Device.dataId != 0");
+                        Log.i(LOG_TAG, "subscribe Device if Device.dataId != 0");
                         break;
 
                     case R.id.btDiscomfortIndex:
                         edtQuery.setText("subscribe Device.DiscomfortIndexSensor if Device.DiscomfortIndexSensor.discomfortIndex > 0");
+                        Log.i(LOG_TAG, "subscribe Device.DiscomfortIndexSensor if Device.DiscomfortIndexSensor.discomfortIndex > 0");
                         break;
                 }
             }
index d0739f5..cb0ece5 100644 (file)
@@ -166,7 +166,7 @@ class CQueryEngineEvent : public OIC::IQueryEngineEvent
             OIC::IModelData      *pModelData = NULL;
             std::vector<std::string>        affectedModels;
 
-            dlog_print(DLOG_ERROR, LOG_TAG, "Event received!");
+            dlog_print(DLOG_INFO, LOG_TAG, "Event received! cqid = %d", cqid);
 
             sprintf(buf, "Event received! cqid = %d<br>", cqid);
             strcpy(log, buf);
@@ -183,10 +183,14 @@ class CQueryEngineEvent : public OIC::IQueryEngineEvent
                 for (int i = 0; i < dataCount; i++)
                 {
                     pResult->getModelData(*itor, i, &pModelData);
+                    dlog_print(DLOG_INFO, LOG_TAG, "dataId: %d<br>", pModelData->getDataId());
                     sprintf(buf, "dataId: %d<br>", pModelData->getDataId());
                     strcat(log, buf);
                     for (int j = 0; j < pModelData->getPropertyCount(); j++)
                     {
+                       dlog_print(DLOG_INFO, LOG_TAG, "Type: %s Value: %s<br>",
+                                (pModelData->getPropertyName(j)).c_str(),
+                                (pModelData->getPropertyValue(j)).c_str());
                         sprintf(buf, "Type: %s Value: %s<br>",
                                 (pModelData->getPropertyName(j)).c_str(),
                                 (pModelData->getPropertyValue(j)).c_str());
@@ -246,11 +250,13 @@ register_cb(void *data , Evas_Object *obj , void *event_info)
     if (res == OIC::SSM_S_OK)
     {
         updateLog(ad, "The query has been registered!<br>");
+        dlog_print(DLOG_INFO, LOG_TAG, "QID : %d\n", qid);
         sprintf(log, "QID : %d<br>", qid);
         updateLog(ad, log);
     }
     else
     {
+       dlog_print(DLOG_INFO, LOG_TAG, "Error occured(%d)\n", res);
         sprintf(log, "Error occured(%d)<br>", res);
         updateLog(ad, log);
     }
@@ -286,6 +292,7 @@ minus_cb(void *data , Evas_Object *obj , void *event_info)
     try
     {
         int val = atoi(query_id_str);
+        dlog_print(DLOG_INFO, LOG_TAG, "%d", val - 1);
         sprintf(output, "%d", val - 1);
         elm_entry_entry_set(ad->unregister_query_id, output);
     }
@@ -306,6 +313,7 @@ plus_cb(void *data , Evas_Object *obj , void *event_info)
     try
     {
         int val = atoi(query_id_str);
+        dlog_print(DLOG_INFO, LOG_TAG, "%d", val + 1);
         sprintf(output, "%d", val + 1);
         elm_entry_entry_set(ad->unregister_query_id, output);
     }
@@ -335,11 +343,13 @@ unregister_cb(void *data , Evas_Object *obj , void *event_info)
         if (res == OIC::SSM_S_OK)
         {
             updateLog(ad, "The query has been unregistered!<br>");
+            dlog_print(DLOG_INFO, LOG_TAG, "QID : %d\n", qid);
             sprintf(log, "QID : %d<br>", qid);
             updateLog(ad, log);
         }
         else
         {
+               dlog_print(DLOG_INFO, LOG_TAG, "Error occured(%d)\n", res);
             sprintf(log, "Error occured(%d)<br>", res);
             updateLog(ad, log);
         }
index a509fe7..e8de3c4 100644 (file)
@@ -38,8 +38,8 @@ import android.util.Log;
  */
 public class ActionListener implements IActionListener {
 
-    private final String     LOG_TAG             = this.getClass()
-                                                         .getSimpleName();
+    private final String     LOG_TAG             = "[TMSample] " + this.getClass()
+                                                                   .getSimpleName();
     private static Message   msg;
     private String           logMessage;
     private GroupApiActivity groupApiActivityObj = null;
index 4795338..ca6b781 100644 (file)
@@ -227,6 +227,7 @@ public class ConfigurationApiActivity extends Activity {
                     case 0:
                         logs.setText("");
                         logs.setText(logMessage);
+                        Log.i(LOG_TAG, logMessage);
                 }
             }
         };
@@ -239,11 +240,9 @@ public class ConfigurationApiActivity extends Activity {
                 .get(CONFIGURATION_COLLECTION_RESOURCE_URI);
         if (null == configurationCollection
                 || null == configurationCollection.resource) {
-            Log.e(LOG_TAG, "configuration collection resource doest not exist!");
             displayToastMessage("Configuration collection resource does not exist!");
         }
         if (false == configurationResourceFlag) {
-            Log.e(LOG_TAG, "configuration resource doest not exist!");
             displayToastMessage("Configuration resource does not exist!");
         } else {
             final Dialog dialog = new Dialog(mcontext);
@@ -465,13 +464,11 @@ public class ConfigurationApiActivity extends Activity {
                 .get(CONFIGURATION_COLLECTION_RESOURCE_URI);
         if (null == configurationCollection
                 || null == configurationCollection.resource) {
-            Log.e(LOG_TAG, "configuration collection resource doest not exist!");
             displayToastMessage("Configuration collection resource does not exist!");
             return;
         }
         if (false == configurationResourceFlag) {
 
-            Log.e(LOG_TAG, "configuration resource doest not exist!");
             displayToastMessage("Configuration resource does not exist!");
             return;
         }
@@ -547,13 +544,11 @@ public class ConfigurationApiActivity extends Activity {
                 .get(DIAGNOSTIC_COLLECTION_RESOURCE_URI);
         if (null == diagnosticsCollection
                 || null == diagnosticsCollection.resource) {
-            Log.e(LOG_TAG, "Diagnostic collection doest not exist!");
             displayToastMessage("Diagnostic collection does not exist!");
             return;
         }
 
         if (false == diagnosticsResourceFlag) {
-            Log.e(LOG_TAG, "Diagnostic resource doest not exist!");
             displayToastMessage("Diagnostic resource does not exist!");
             return;
         }
@@ -587,12 +582,10 @@ public class ConfigurationApiActivity extends Activity {
                 .get(DIAGNOSTIC_COLLECTION_RESOURCE_URI);
         if (null == diagnosticsCollection
                 || null == diagnosticsCollection.resource) {
-            Log.e(LOG_TAG, "Diagnostic collection doest not exist!");
             displayToastMessage("Diagnostic collection does not exist!");
             return;
         }
         if (false == diagnosticsResourceFlag) {
-            Log.e(LOG_TAG, "Diagnostic resource doest not exist!");
             displayToastMessage("Diagnostic resource does not exist!");
             return;
         }
@@ -626,6 +619,7 @@ public class ConfigurationApiActivity extends Activity {
     private void displayToastMessage(String message) {
         Toast toast = Toast.makeText(this, message, Toast.LENGTH_SHORT);
         toast.show();
+        Log.i(LOG_TAG, message);
     }
 
     private void collectionFound(OcResource resource) {
index 935eb4f..d5e502e 100644 (file)
@@ -32,7 +32,7 @@ import android.util.Log;
  */
 public class ConfigurationListener implements IConfigurationListener {
 
-    private final String LOG_TAG = this.getClass().getSimpleName();
+    private final String LOG_TAG = "[TMSample] " + this.getClass().getSimpleName();
 
     @Override
     public void onBootStrapCallback(Vector<OcHeaderOption> headerOptions,
index 31132d8..9905015 100644 (file)
@@ -32,7 +32,7 @@ import android.util.Log;
  */
 public class DiagnosticListener implements IDiagnosticsListener {
 
-    private final String LOG_TAG = this.getClass().getSimpleName();
+    private final String LOG_TAG = "[TMSample] " + this.getClass().getSimpleName();
 
     @Override
     public void onRebootCallback(Vector<OcHeaderOption> headerOptions,
index 02a3c5f..3ab7793 100644 (file)
@@ -28,6 +28,7 @@ import android.content.Context;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
+import android.util.Log;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.AdapterView;
@@ -62,6 +63,9 @@ public class GroupApiActivity extends Activity {
     // For Scheduled ActionSet
     public static Context           mcontext;
     public static Calendar          scheduleTime;
+    
+    private final String            LOG_TAG = "[TMSample] " + this.getClass()
+                                                               .getSimpleName();;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -112,6 +116,7 @@ public class GroupApiActivity extends Activity {
                     case 1:
                         logs.setText("");
                         logs.setText(logMessage);
+                        Log.i(LOG_TAG, logMessage);
                 }
             }
         };
@@ -249,5 +254,6 @@ public class GroupApiActivity extends Activity {
     public void displayToastMessage(String message) {
         Toast toast = Toast.makeText(this, message, Toast.LENGTH_SHORT);
         toast.show();
+        Log.i(LOG_TAG, message);
     }
 }
index 093dfac..0bc6d72 100644 (file)
@@ -50,7 +50,7 @@ import android.util.Log;
  */
 public class GroupClient {
 
-    private static final String     LOG_TAG             = "GroupClient";
+    private static final String     LOG_TAG             = "[TMSample] GroupClient";
     private static Message          msg;
     public String                   logMessage;
 
@@ -99,8 +99,8 @@ public class GroupClient {
                 String uri = resource.getUri();
                 if (uri.equals("/b/collection") == true) {
                     String hostAddress = resource.getHost();
-                    Log.d("URI: onGroupFindCallback", uri);
-                    Log.d("HOST: onGroupFindCallback", hostAddress);
+                    Log.d(LOG_TAG, "onGroupFindCallback URI : " + uri);
+                    Log.d(LOG_TAG, "onGroupFindCallback HOST : " + hostAddress);
 
                     groupResource = resource;
                     Message msg = Message.obtain();
@@ -115,7 +115,7 @@ public class GroupClient {
                     msg.what = 1;
                     groupApiActivityObj.getHandler().sendMessage(msg);
                 } else {
-                    Log.d("onGroupFindCallback URI : ", uri);
+                    Log.d(LOG_TAG, "onGroupFindCallback URI : " + uri);
                 }
             } else {
                 Log.i(LOG_TAG, "Resource is NULL");
index 2482055..3ea6935 100644 (file)
@@ -54,8 +54,8 @@ public class MainActivity extends Activity {
     private ArrayAdapter<String> apis;
     private ArrayList<String>    apisList;
     private ListView             list;
-    private final String         LOG_TAG          = this.getClass()
-                                                          .getSimpleName();
+    private final String         LOG_TAG          = "[TMSample] " + this.getClass()
+                                                                           .getSimpleName();
     public ThingsManager         thingsManagerObj = new ThingsManager();
 
     @Override
@@ -130,6 +130,7 @@ public class MainActivity extends Activity {
 
             dialog = dialogBuilder.create();
             dialog.show();
+            Log.i(LOG_TAG, "WiFi is not enabled/connected! Please connect the WiFi and start application again...");
             return;
         }
         // If wifi is connected calling the configure method for configuring the
index 63d9286..1acdc3b 100644 (file)
@@ -46,7 +46,7 @@ import android.widget.EditText;
  */
 public class MainActivity extends Activity {
 
-    private final String         LOG_TAG = this.getClass().getSimpleName();
+    private final String         LOG_TAG = "[CON-SERVER]" + this.getClass().getSimpleName();
     private Handler              mHandler;
     private static MainActivity  mainActivityObj;
     private ConfigurationServer  conServerObj;
@@ -72,6 +72,7 @@ public class MainActivity extends Activity {
                 switch (msg.what) {
                     case 0:
                         editText.setText(message);
+                        Log.i(LOG_TAG, message);
                 }
             }
         };
@@ -124,6 +125,7 @@ public class MainActivity extends Activity {
 
             AlertDialog dialog = dialogBuilder.create();
             dialog.show();
+            Log.i(LOG_TAG, "WiFi is not enabled/connected! Please connect the WiFi and start application again...");
             return;
         }
 
@@ -162,6 +164,7 @@ public class MainActivity extends Activity {
         dialog.setProgress(0);
         dialog.setMax(100);
         dialog.show();
+        Log.i(LOG_TAG, "Rebooting.. Please wait ...");
         Thread thread = new Thread() {
             @Override
             public void run() {
index de6c1b3..c58825f 100644 (file)
@@ -214,6 +214,7 @@ OCEntityHandlerResult entityHandlerForResource(std::shared_ptr< OCResourceReques
         if (OC_STACK_OK == sendResponseForResource(request))
         {
             ehResult = OC_EH_OK;
+            dlog_print(DLOG_INFO, LOG_TAG, "#### sendResponse success.");
         }
         else
         {
@@ -235,6 +236,7 @@ void *updateLog(void *data)
     elm_entry_entry_append(log_entry, log->c_str());
     elm_entry_cursor_end_set(log_entry);
 
+    dlog_print(DLOG_INFO, LOG_TAG, "%s", log->c_str());
     dlog_print(DLOG_INFO, LOG_TAG, "#### updateLog exit!!!!");
 
     return NULL;
@@ -296,6 +298,8 @@ void onBootStrapCallback(const HeaderOptions &headerOptions, const OCRepresentat
     logMessage += "currency : " + defaultCurrency + "<br>";
     logMessage += "Region : " + defaultRegion + "<br>";
 
+    dlog_print(DLOG_INFO, LOG_TAG, "  %s", logMessage.c_str());
+
     //Call updateLog in the thread safe mode
     ecore_main_loop_thread_safe_call_sync(updateLog, &logMessage);
 
@@ -343,6 +347,8 @@ createConfResource_cb(void *data , Evas_Object *obj , void *event_info)
     {
         logMessage += "Resources were created already!!! <br>";
     }
+
+    dlog_print(DLOG_INFO, LOG_TAG, "  %s", logMessage.c_str());
     // Show the log in the UI
     ecore_main_loop_thread_safe_call_sync(updateLog, &logMessage);
 }
index 7510b8c..fca08f6 100644 (file)
@@ -141,6 +141,7 @@ void DiagnosticsResource::diagnosticsMonitor(int second)
             logMessage = "----------------------------<br>";
             logMessage += "*** System Reboot Success ***<br>";
 
+            dlog_print(DLOG_INFO, LOG_TAG, "  %s", logMessage.c_str());
             //Show the log
             ecore_main_loop_thread_safe_call_sync(updateLog, &logMessage);
 
index edc82f8..4d09f54 100644 (file)
@@ -99,6 +99,7 @@ void onFoundCollectionResource(std::vector< std::shared_ptr< OCResource > > reso
                 logMessage += "----------------------<br>";
                 dlog_print(DLOG_INFO, LOG_TAG, "FoundHost: %s", resourceURI.c_str());
                 dlog_print(DLOG_INFO, LOG_TAG, "FoundUri : %s", hostAddress.c_str());
+                dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
                 ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog,
                                                       &logMessage);
 
@@ -117,7 +118,9 @@ void onFoundCollectionResource(std::vector< std::shared_ptr< OCResource > > reso
             else
             {
                 // Resource is invalid
+
                 logMessage = "Found Resource invalid!";
+                dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
                 ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog,
                                                       &logMessage);
             }
@@ -168,6 +171,7 @@ void onFoundCandidateResource(std::vector< std::shared_ptr< OCResource > > resou
                         logMessage += "----------------------<br>";
                         dlog_print(DLOG_INFO, LOG_TAG, "Host: %s", resourceURI.c_str());
                         dlog_print(DLOG_INFO, LOG_TAG, "Uri : %s", hostAddress.c_str());
+                        dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
                         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog,
                                                               &logMessage);
 
@@ -294,6 +298,7 @@ static void onUpdateConfigurationsCallback(const HeaderOptions &headerOptions,
         logMessage = logMessage + "Region : " + rep.getValue< std::string >("r") + "<br>";
     }
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog,
                                           &logMessage);
     dlog_print(DLOG_INFO, LOG_TAG, "#### onUpdateConfigurationsCallback: EXIT!!!!");
@@ -343,6 +348,7 @@ static void onGetConfigurationsCallback(const HeaderOptions &headerOptions,
     }
 
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
     dlog_print(DLOG_INFO, LOG_TAG, "#### onGetConfigurationsCallback: exit!!!!");
 }
@@ -366,6 +372,7 @@ static void onFactoryReset(const HeaderOptions &headerOptions, const OCRepresent
     logMessage = logMessage + "FactoryReset : " +
                  rep.getValue< std::string >("value") + "<br>";
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
     dlog_print(DLOG_INFO, LOG_TAG, "#### onFactoryReset: exit!!!!");
 }
@@ -389,6 +396,7 @@ static void onReboot(const HeaderOptions &headerOptions, const OCRepresentation
     logMessage = logMessage + "Reboot : " +
                  rep.getValue< std::string >("value") + "<br>";
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
     dlog_print(DLOG_INFO, LOG_TAG, "#### onReboot: exit!!!!");
 }
@@ -412,6 +420,7 @@ static void createResourceCollection(string uri, string typeName, OCResourceHand
     string logMessage;
     logMessage = "Resource created : <br>" + typeName + "<br>";
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
     dlog_print(DLOG_INFO, LOG_TAG, "#### createResourceCollection: exit!!!!");
 }
@@ -514,6 +523,7 @@ static void getConfiguration(void *data, Evas_Object *obj, void *event_info)
     {
         dlog_print(DLOG_ERROR, LOG_TAG, "Note that you first create a group to use this command");
         string logMessage = "FIRST CREATE GROUP <br>";
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
         return;
     }
@@ -547,6 +557,7 @@ static void updateConfiguration(std::string newRegionValue)
         dlog_print(DLOG_ERROR, LOG_TAG, "Note that you first create a group to use this command");
         string logMessage = "FIRST CREATE GROUP <br>";
         logMessage += "----------------------<br>";
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
         return;
     }
@@ -572,6 +583,7 @@ static void updateConfiguration(std::string newRegionValue)
     {
         string logMessage = "UpdateConfigurations called successfully<br>";
         logMessage += "----------------------<br>";
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
     }
 
@@ -587,6 +599,7 @@ static void factoryReset(void *data, Evas_Object *obj, void *event_info)
         dlog_print(DLOG_ERROR, LOG_TAG, "Note that you first create a group to use this command");
         string logMessage = "FIRST CREATE GROUP <br>";
         logMessage += "----------------------<br>";
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
         return;
     }
@@ -606,6 +619,7 @@ static void factoryReset(void *data, Evas_Object *obj, void *event_info)
     {
         string logMessage = "FactoryReset called successfully<br>";
         logMessage += "----------------------<br>";
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
     }
 
@@ -621,6 +635,7 @@ static void reboot(void *data, Evas_Object *obj, void *event_info)
         dlog_print(DLOG_INFO, LOG_TAG, "Note that you first create a group to use this command");
         string logMessage = "FIRST CREATE GROUP <br>";
         logMessage += "----------------------<br>";
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
         return;
     }
@@ -640,6 +655,7 @@ static void reboot(void *data, Evas_Object *obj, void *event_info)
     {
         string logMessage = "Reboot called successfully<br>";
         logMessage += "----------------------<br>";
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
     }
     dlog_print(DLOG_INFO, LOG_TAG, "#### reboot EXIT!!!!");
@@ -657,6 +673,7 @@ static void getListOfSupportedConfigurationUnits(void *data, Evas_Object *obj, v
     string logMessage;
     logMessage = "Supported Configuration List :<br>" + listOfSupportedConfigurationUnits + "<br>";
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
     dlog_print(DLOG_INFO, LOG_TAG, "#### getListOfSupportedConfigurationUnits EXIT!!!!");
 }
@@ -708,6 +725,7 @@ popup_set_clicked_cb(void *data, Evas_Object *obj, void *event_info)
         dlog_print(DLOG_INFO, LOG_TAG, "#### Read NULL RegionValue");
         string logMessage = "Region Value should not be NULL<br>";
         logMessage += "----------------------<br>";
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
     }
     else
@@ -726,6 +744,7 @@ list_update_region_cb(void *data, Evas_Object *obj, void *event_info)
     {
         dlog_print(DLOG_ERROR, LOG_TAG, "Note that you first create a group to use this command");
         string logMessage = "FIRST CREATE GROUP <br>";
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateConfigLog, &logMessage);
         return;
     }
index e8924bd..d2a70ee 100644 (file)
@@ -76,6 +76,7 @@ void onPut(const HeaderOptions &headerOptions, const OCRepresentation &rep, cons
         dlog_print(DLOG_INFO, LOG_TAG, "#### Invalid Parameter");
     }
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
                                           &logMessage);
 }
@@ -127,6 +128,7 @@ void onPost(const HeaderOptions &headerOptions, const OCRepresentation &rep, con
         }
     }
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
                                           &logMessage);
     dlog_print(DLOG_INFO, LOG_TAG, "#### onPost callback received EXIT!!!!");
@@ -146,6 +148,7 @@ static void createActionSet_AllBulbOff()
         string logMessage = "NO LIGHTSERVER FOUND <br>";
         logMessage += "----------------------<br>";
         dlog_print(DLOG_INFO, LOG_TAG, "#### NO LIGHT SERVER FOUND");
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
                                               &logMessage);
         delete actionSet;
@@ -182,6 +185,7 @@ static void createActionSet_AllBulbOff()
 
     string logMessage = "Create actionset AllBulbOFF success <br>";
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
     dlog_print(DLOG_INFO, LOG_TAG, "#### createActionSet_AllBulbOff EXIT");
 }
@@ -239,6 +243,7 @@ static void createActionSet_AllBulbOn()
 
     string logMessage = "Create actionset AllBulbON success <br>";
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
     dlog_print(DLOG_INFO, LOG_TAG, "#### createActionSet_AllBulbOff OFF EXIT");
 }
@@ -392,6 +397,7 @@ static void executeActionSetOff(void *data, Evas_Object *obj, void *event_info)
 
     string logMessage = "Actionset OFF called successfully <br>";
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
     dlog_print(DLOG_INFO, LOG_TAG, "#### executeActionSetOff EXIT");
 }
@@ -426,6 +432,7 @@ static void executeActionSetOn(void *data, Evas_Object *obj, void *event_info)
 
     string logMessage = "Actionset ON called successfully <br>";
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
     dlog_print(DLOG_INFO, LOG_TAG, "#### executeActionSetOn EXIT");
 }
@@ -522,6 +529,7 @@ static void deleteActionSetOff(void *data, Evas_Object *obj, void *event_info)
 
     string logMessage = "Actionset OFF DELETED <br>";
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
     dlog_print(DLOG_INFO, LOG_TAG, "#### deleteActionSetOff EXIT");
 }
@@ -556,6 +564,7 @@ static void deleteActionSetOn(void *data, Evas_Object *obj, void *event_info)
 
     string logMessage = "Actionset ON DELETED <br>";
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
     dlog_print(DLOG_INFO, LOG_TAG, "#### deleteActionSetOn EXIT");
 }
@@ -600,6 +609,7 @@ void onObserve(const HeaderOptions headerOptions, const OCRepresentation &rep, c
         logMessage = "onObserve error!!!";
     }
     logMessage += "----------------------<br>";
+    dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
     ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
                                           &logMessage);
 }
@@ -661,6 +671,7 @@ void foundResources(std::vector< std::shared_ptr< OC::OCResource > > listOfResou
                 (*rsrc)->observe(ObserveType::Observe, QueryParamsMap(), &onObserve);
                 dlog_print(DLOG_INFO, LOG_TAG, "#### after calling observe() for bookmark!!!!");
             }
+            dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
             ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
                                                   &logMessage);
         }
@@ -869,6 +880,7 @@ popup_set_clicked_cb(void *data, Evas_Object *obj, void *event_info)
         dlog_print(DLOG_INFO, LOG_TAG, "#### Read NULL DateTime Value");
         string logMessage = "DateTime should not be NULL<br>";
         logMessage += "----------------------<br>";
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog, &logMessage);
     }
     else
@@ -898,6 +910,7 @@ popup_set_clicked_cb(void *data, Evas_Object *obj, void *event_info)
             dlog_print(DLOG_INFO, LOG_TAG, "#### Incorrect date/time values");
             string logMessage = "Incorrect date/time value<br>";
             logMessage += "----------------------<br>";
+            dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
             ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
                                                   &logMessage);
         }
@@ -1037,6 +1050,7 @@ void foundResource(shared_ptr< OCResource > resource)
             ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))showGroupAPIs, NULL);
 
         }
+        dlog_print(DLOG_INFO, LOG_TAG, " %s", logMessage.c_str());
         ecore_main_loop_thread_safe_call_sync((void * ( *)(void *))updateGroupLog,
                                               &logMessage);
     }