add console message verbose mode with 'verbose' key
authorInhwan Lee <ideal.lee@samsung.com>
Thu, 7 Apr 2016 06:15:22 +0000 (15:15 +0900)
committerInhwan Lee <ideal.lee@samsung.com>
Thu, 7 Apr 2016 06:15:22 +0000 (15:15 +0900)
runtime/browser/web_application.cc
runtime/browser/web_application.h [changed mode: 0644->0755]

index e9b211d..b01c3ee 100755 (executable)
@@ -58,6 +58,7 @@ const char* kConsoleLogEnableKey = "WRT_CONSOLE_LOG_ENABLE";
 const char* kConsoleMessageLogTag = "ConsoleMessage";
 
 const char* kDebugKey = "debug";
+const char* kVerboseKey = "verbose";
 const char* kPortKey = "port";
 
 const char* kAppControlEventScript =
@@ -206,6 +207,7 @@ WebApplication::WebApplication(
     NativeWindow* window, std::unique_ptr<common::ApplicationData> app_data)
     : launched_(false),
       debug_mode_(false),
+      verbose_mode_(false),
       ewk_context_(
           ewk_context_new_with_injected_bundle_path(INJECTED_BUNDLE_PATH)),
       window_(window),
@@ -373,6 +375,9 @@ void WebApplication::Launch(std::unique_ptr<common::AppControl> appcontrol) {
     debug_mode_ = true;
     LaunchInspector(appcontrol.get());
   }
+  if (appcontrol->data(kVerboseKey) == "true") {
+    verbose_mode_ = true;
+  }
 
   // TODO(sngn.lee): check the below code location.
   // in Wearable, webkit can render contents before show window
@@ -415,6 +420,9 @@ void WebApplication::AppControl(
     debug_mode_ = true;
     LaunchInspector(appcontrol.get());
   }
+  if (!verbose_mode_ && appcontrol->data(kVerboseKey) == "true") {
+    verbose_mode_ = true;
+  }
   window_->Active();
 }
 
@@ -632,7 +640,7 @@ void WebApplication::OnConsoleMessage(const std::string& msg, int level) {
   static bool enabled = (getenv(kConsoleLogEnableKey) != NULL);
   enabled = true;
 
-  if (debug_mode_ || enabled) {
+  if (debug_mode_ || verbose_mode_ || enabled) {
     int dlog_level = DLOG_DEBUG;
     switch (level) {
       case EWK_CONSOLE_MESSAGE_LEVEL_WARNING:
old mode 100644 (file)
new mode 100755 (executable)
index 36caeaa..2193e18
@@ -100,6 +100,7 @@ class WebApplication : public WebView::EventListener {
 
   bool launched_;
   bool debug_mode_;
+  bool verbose_mode_;
   Ewk_Context* ewk_context_;
   NativeWindow* window_;
   std::string appid_;