From: Inhwan Lee Date: Thu, 7 Apr 2016 06:15:22 +0000 (+0900) Subject: add console message verbose mode with 'verbose' key X-Git-Tag: accepted/tizen/common/20160428.144556~4^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64310f4c3b405d9f22eea30897b3c61d9009b109;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git add console message verbose mode with 'verbose' key --- diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index e9b211d..b01c3ee 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -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 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 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: diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h old mode 100644 new mode 100755 index 36caeaa..2193e18 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -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_;