8
8
9
9
#include " flutter/shell/platform/common/json_method_codec.h"
10
10
#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"
12
12
13
13
namespace flutter {
14
14
@@ -46,6 +46,7 @@ bool IsASCIIPrintableKey(char c) {
46
46
}
47
47
return false ;
48
48
}
49
+
49
50
} // namespace
50
51
51
52
TextInputChannel::TextInputChannel (BinaryMessenger* messenger,
@@ -63,7 +64,7 @@ TextInputChannel::TextInputChannel(BinaryMessenger* messenger,
63
64
64
65
// Set input method callbacks
65
66
input_method_context_->SetOnCommitCallback ([this ](std::string str) -> void {
66
- FT_LOGI ( " OnCommit str[%s] " , str. data ()) ;
67
+ FT_LOG (Debug) << " OnCommit: " << str;
67
68
text_editing_context_.edit_status_ = EditStatus::kCommit ;
68
69
ConsumeLastPreedit ();
69
70
active_model_->AddText (str);
@@ -95,9 +96,10 @@ TextInputChannel::TextInputChannel(BinaryMessenger* messenger,
95
96
active_model_->selection ().base ();
96
97
text_editing_context_.has_preedit_ = true ;
97
98
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_ ;
101
103
}
102
104
});
103
105
@@ -133,8 +135,7 @@ void TextInputChannel::HandleMethodCall(
133
135
const MethodCall<rapidjson::Document>& method_call,
134
136
std::unique_ptr<MethodResult<rapidjson::Document>> result) {
135
137
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;
138
139
139
140
if (method.compare (kShowMethod ) == 0 ) {
140
141
input_method_context_->ShowInputPannel ();
@@ -253,7 +254,7 @@ void TextInputChannel::SendStateUpdate(const TextInputModel& model) {
253
254
kTextKey , rapidjson::Value (model.GetText (), allocator).Move (), allocator);
254
255
args->PushBack (editing_state, allocator);
255
256
256
- FT_LOGI ( " Send text[%s] " , model.GetText (). data () );
257
+ FT_LOG (Info) << " Send text: " << model.GetText ();
257
258
channel_->InvokeMethod (kUpdateEditingStateMethod , std::move (args));
258
259
}
259
260
@@ -268,7 +269,7 @@ bool TextInputChannel::FilterEvent(Ecore_Event_Key* event) {
268
269
// FIXME: Only for wearable.
269
270
if (is_ime && strcmp (event->key , " Select" ) == 0 ) {
270
271
text_editing_context_.is_in_select_mode_ = true ;
271
- FT_LOGI ( " Set select mode[true] " ) ;
272
+ FT_LOG (Debug) << " Entering select mode. " ;
272
273
}
273
274
#else
274
275
bool is_ime = strcmp (ecore_device_name_get (event->dev ), " ime" ) == 0 ;
@@ -277,7 +278,7 @@ bool TextInputChannel::FilterEvent(Ecore_Event_Key* event) {
277
278
if (ShouldNotFilterEvent (event->key , is_ime)) {
278
279
ResetTextEditingContext ();
279
280
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 ;
281
282
return false ;
282
283
}
283
284
@@ -292,7 +293,7 @@ bool TextInputChannel::FilterEvent(Ecore_Event_Key* event) {
292
293
text_editing_context_.is_in_select_mode_ ) {
293
294
text_editing_context_.is_in_select_mode_ = false ;
294
295
handled = true ;
295
- FT_LOGI ( " Set select mode[false] " ) ;
296
+ FT_LOG (Debug) << " Leaving select mode. " ;
296
297
}
297
298
#endif
298
299
@@ -303,7 +304,7 @@ void TextInputChannel::HandleUnfilteredEvent(Ecore_Event_Key* event) {
303
304
#ifdef MOBILE_PROFILE
304
305
// FIXME: Only for mobile.
305
306
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 ;
307
308
ResetTextEditingContext ();
308
309
return ;
309
310
}
@@ -372,8 +373,8 @@ void TextInputChannel::ConsumeLastPreedit() {
372
373
text_editing_context_.preedit_start_pos_ ;
373
374
active_model_->DeleteSurrounding (-count, count);
374
375
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;
377
378
SendStateUpdate (*active_model_);
378
379
}
379
380
text_editing_context_.has_preedit_ = false ;
0 commit comments