88
99#include " flutter/shell/platform/common/json_method_codec.h"
1010#include " flutter/shell/platform/tizen/flutter_tizen_engine.h"
11- #include " flutter/shell/platform/tizen/tizen_log .h"
11+ #include " flutter/shell/platform/tizen/logger .h"
1212
1313namespace flutter {
1414
@@ -46,6 +46,7 @@ bool IsASCIIPrintableKey(char c) {
4646 }
4747 return false ;
4848}
49+
4950} // namespace
5051
5152TextInputChannel::TextInputChannel (BinaryMessenger* messenger,
@@ -63,7 +64,7 @@ TextInputChannel::TextInputChannel(BinaryMessenger* messenger,
6364
6465 // Set input method callbacks
6566 input_method_context_->SetOnCommitCallback ([this ](std::string str) -> void {
66- FT_LOGI ( " OnCommit str[%s] " , str. data ()) ;
67+ FT_LOG (Debug) << " OnCommit: " << str;
6768 text_editing_context_.edit_status_ = EditStatus::kCommit ;
6869 ConsumeLastPreedit ();
6970 active_model_->AddText (str);
@@ -95,9 +96,10 @@ TextInputChannel::TextInputChannel(BinaryMessenger* messenger,
9596 active_model_->selection ().base ();
9697 text_editing_context_.has_preedit_ = true ;
9798 SendStateUpdate (*active_model_);
98- FT_LOGI (" preedit start pos[%d], preedit end pos[%d]" ,
99- text_editing_context_.preedit_start_pos_ ,
100- text_editing_context_.preedit_end_pos_ );
99+ FT_LOG (Debug) << " Preedit start position: "
100+ << text_editing_context_.preedit_start_pos_
101+ << " , end position: "
102+ << text_editing_context_.preedit_end_pos_ ;
101103 }
102104 });
103105
@@ -133,8 +135,7 @@ void TextInputChannel::HandleMethodCall(
133135 const MethodCall<rapidjson::Document>& method_call,
134136 std::unique_ptr<MethodResult<rapidjson::Document>> result) {
135137 const std::string& method = method_call.method_name ();
136-
137- FT_LOGI (" Handle Method : %s" , method.data ());
138+ FT_LOG (Debug) << " Handle a method: " << method;
138139
139140 if (method.compare (kShowMethod ) == 0 ) {
140141 input_method_context_->ShowInputPannel ();
@@ -253,7 +254,7 @@ void TextInputChannel::SendStateUpdate(const TextInputModel& model) {
253254 kTextKey , rapidjson::Value (model.GetText (), allocator).Move (), allocator);
254255 args->PushBack (editing_state, allocator);
255256
256- FT_LOGI ( " Send text[%s] " , model.GetText (). data () );
257+ FT_LOG (Info) << " Send text: " << model.GetText ();
257258 channel_->InvokeMethod (kUpdateEditingStateMethod , std::move (args));
258259}
259260
@@ -268,7 +269,7 @@ bool TextInputChannel::FilterEvent(Ecore_Event_Key* event) {
268269 // FIXME: Only for wearable.
269270 if (is_ime && strcmp (event->key , " Select" ) == 0 ) {
270271 text_editing_context_.is_in_select_mode_ = true ;
271- FT_LOGI ( " Set select mode[true] " ) ;
272+ FT_LOG (Debug) << " Entering select mode. " ;
272273 }
273274#else
274275 bool is_ime = strcmp (ecore_device_name_get (event->dev ), " ime" ) == 0 ;
@@ -277,7 +278,7 @@ bool TextInputChannel::FilterEvent(Ecore_Event_Key* event) {
277278 if (ShouldNotFilterEvent (event->key , is_ime)) {
278279 ResetTextEditingContext ();
279280 input_method_context_->ResetInputMethodContext ();
280- FT_LOGW ( " Force redirect IME key- event[%s] to fallback " , event->keyname ) ;
281+ FT_LOG (Info) << " Force redirect an IME key event: " << event->keyname ;
281282 return false ;
282283 }
283284
@@ -292,7 +293,7 @@ bool TextInputChannel::FilterEvent(Ecore_Event_Key* event) {
292293 text_editing_context_.is_in_select_mode_ ) {
293294 text_editing_context_.is_in_select_mode_ = false ;
294295 handled = true ;
295- FT_LOGI ( " Set select mode[false] " ) ;
296+ FT_LOG (Debug) << " Leaving select mode. " ;
296297 }
297298#endif
298299
@@ -303,7 +304,7 @@ void TextInputChannel::HandleUnfilteredEvent(Ecore_Event_Key* event) {
303304#ifdef MOBILE_PROFILE
304305 // FIXME: Only for mobile.
305306 if (text_editing_context_.edit_status_ == EditStatus::kPreeditEnd ) {
306- FT_LOGW ( " Ignore key- event[%s]! " , event->keyname ) ;
307+ FT_LOG (Warn) << " Ignore a key event: " << event->keyname ;
307308 ResetTextEditingContext ();
308309 return ;
309310 }
@@ -372,8 +373,8 @@ void TextInputChannel::ConsumeLastPreedit() {
372373 text_editing_context_.preedit_start_pos_ ;
373374 active_model_->DeleteSurrounding (-count, count);
374375 std::string after = active_model_->GetText ();
375- FT_LOGI ( " Consume last preedit count:[%d] text:[%s] -> [%s] " , count,
376- before. data (), after. data ()) ;
376+ FT_LOG (Debug) << " Last preedit count: " << count << " , text: " << before
377+ << " -> " << after;
377378 SendStateUpdate (*active_model_);
378379 }
379380 text_editing_context_.has_preedit_ = false ;
0 commit comments