From 9c0d429d5e1a49b667de22f53d03c4cbb2323a85 Mon Sep 17 00:00:00 2001 From: "swan.seo" Date: Wed, 29 Nov 2023 21:33:45 +1100 Subject: [PATCH] Remove duplicated log --- packages/webview_flutter/tizen/src/webview.cc | 34 +++++-------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/packages/webview_flutter/tizen/src/webview.cc b/packages/webview_flutter/tizen/src/webview.cc index c472e885c..8fe79c97b 100644 --- a/packages/webview_flutter/tizen/src/webview.cc +++ b/packages/webview_flutter/tizen/src/webview.cc @@ -10,8 +10,6 @@ #include #include -#include - #include "buffer_pool.h" #include "ewk_internal_api_binding.h" #include "log.h" @@ -676,31 +674,17 @@ void WebView::OnConsoleMessage(void* data, Evas_Object* obj, void* event_info) { Ewk_Console_Message* message = static_cast(event_info); Ewk_Console_Message_Level log_level = EwkInternalApiBinding::GetInstance().console_message.LevelGet(message); - std::string source = - EwkInternalApiBinding::GetInstance().console_message.SourceGet(message); - int32_t line = - EwkInternalApiBinding::GetInstance().console_message.LineGet(message); std::string text = EwkInternalApiBinding::GetInstance().console_message.TextGet(message); - std::ostream& stream = - log_level == EWK_CONSOLE_MESSAGE_LEVEL_ERROR ? std::cerr : std::cout; - stream << "WebView: "; - if (!source.empty() && line > 0) { - stream << source << "(" << line << ") > "; - } - stream << text << std::endl; - - if (obj) { - WebView* webview = static_cast(data); - if (webview->webview_controller_channel_) { - flutter::EncodableMap args = { - {flutter::EncodableValue("level"), - flutter::EncodableValue(ConvertLogLevelToString(log_level))}, - {flutter::EncodableValue("message"), flutter::EncodableValue(text)}, - }; - webview->webview_controller_channel_->InvokeMethod( - "onConsoleMessage", std::make_unique(args)); - } + WebView* webview = static_cast(data); + if (webview->webview_controller_channel_) { + flutter::EncodableMap args = { + {flutter::EncodableValue("level"), + flutter::EncodableValue(ConvertLogLevelToString(log_level))}, + {flutter::EncodableValue("message"), flutter::EncodableValue(text)}, + }; + webview->webview_controller_channel_->InvokeMethod( + "onConsoleMessage", std::make_unique(args)); } }