Skip to content

Commit 3d8e304

Browse files
pkoskoswift-kim
authored andcommitted
[Logs] Cleaning code from debug logs (#108)
* [Logs] Cleaning code from debug logs This commit: * removes redundant debug logs * changes some valuable debug logs into LOGI level * changes some logs to LOGW level * [Logging] Added verbose-system-logs handling All logs are filtered via flag usage: * flutter-tizen run --verbose-system-logs all logs are visible in flutter console, including INFO * flutter-tizen run only ERROR logs are visible in console * [Logs] Clean remaining LOGD from code * remove some redundant logs * change some meaningful logs to LOGI or LOGW
1 parent 1ea7ff0 commit 3d8e304

13 files changed

+62
-78
lines changed

shell/platform/tizen/channels/key_event_channel.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ KeyEventChannel::KeyEventChannel(flutter::BinaryMessenger* messenger)
222222
KeyEventChannel::~KeyEventChannel() {}
223223

224224
void KeyEventChannel::SendKeyEvent(Ecore_Event_Key* key, bool is_down) {
225-
FT_LOGD("code: %d, name: %s, mods: %d, type: %s", key->keycode, key->keyname,
225+
FT_LOGI("code: %d, name: %s, mods: %d, type: %s", key->keycode, key->keyname,
226226
key->modifiers, is_down ? kKeyDown : kKeyUp);
227227

228228
int gtk_keycode = 0;

shell/platform/tizen/channels/lifecycle_channel.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ void LifecycleChannel::SendLifecycleMessage(const char message[]) {
2525
}
2626

2727
void LifecycleChannel::AppIsInactive() {
28-
FT_LOGD("send app lifecycle state inactive.");
28+
FT_LOGI("send app lifecycle state inactive.");
2929
SendLifecycleMessage(kInactive);
3030
}
3131

3232
void LifecycleChannel::AppIsResumed() {
33-
FT_LOGD("send app lifecycle state resumed.");
33+
FT_LOGI("send app lifecycle state resumed.");
3434
SendLifecycleMessage(kResumed);
3535
}
3636

3737
void LifecycleChannel::AppIsPaused() {
38-
FT_LOGD("send app lifecycle state paused.");
38+
FT_LOGI("send app lifecycle state paused.");
3939
SendLifecycleMessage(kPaused);
4040
}
4141

4242
void LifecycleChannel::AppIsDetached() {
43-
FT_LOGD("send app lifecycle state detached.");
43+
FT_LOGI("send app lifecycle state detached.");
4444
SendLifecycleMessage(kDetached);
4545
}

shell/platform/tizen/channels/localization_channel.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void LocalizationChannel::SendLocales() {
3737

3838
flutter_locale = GetFlutterLocale(without_encoding_type.data());
3939
if (flutter_locale) {
40-
FT_LOGD("Choose Default locale[%s]", without_encoding_type.data());
40+
FT_LOGI("Choose Default locale[%s]", without_encoding_type.data());
4141
flutter_locales.push_back(flutter_locale);
4242
}
4343

@@ -52,7 +52,7 @@ void LocalizationChannel::SendLocales() {
5252
}
5353
}
5454

55-
FT_LOGD("Send %zu available locales", flutter_locales.size());
55+
FT_LOGI("Send %zu available locales", flutter_locales.size());
5656
// Send locales to engine
5757
engine_->UpdateLocales(
5858
const_cast<const FlutterLocale**>(flutter_locales.data()),

shell/platform/tizen/channels/platform_channel.cc

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ class FeedbackManager {
5454
};
5555

5656
static std::string GetVibrateVariantName(const char* haptic_feedback_type) {
57-
FT_LOGD(
58-
"Enter FeedbackManager::GetVibrateVariantName(): haptic_feedback_type: "
59-
"(%s)",
60-
haptic_feedback_type);
61-
6257
if (!haptic_feedback_type) {
6358
return "HapticFeedback.vibrate";
6459
}
@@ -76,11 +71,6 @@ class FeedbackManager {
7671
static std::string GetErrorMessage(ResultCode result_code,
7772
const std::string& method_name,
7873
const std::string& args = "") {
79-
FT_LOGD(
80-
"Enter FeedbackManager::GetErrorMessage(): result_code: [%d], "
81-
"method_name: (%s), args: (%s)",
82-
static_cast<int>(result_code), method_name.c_str(), args.c_str());
83-
8474
const auto method_name_with_args = method_name + "(" + args + ")";
8575

8676
switch (result_code) {
@@ -98,8 +88,6 @@ class FeedbackManager {
9888
}
9989

10090
static FeedbackManager& GetInstance() {
101-
FT_LOGD("Enter FeedbackManager::GetInstance()");
102-
10391
static FeedbackManager instance;
10492
return instance;
10593
}
@@ -108,7 +96,7 @@ class FeedbackManager {
10896
FeedbackManager& operator=(const FeedbackManager&) = delete;
10997

11098
ResultCode Play(FeedbackType type, FeedbackPattern pattern) {
111-
FT_LOGD("Enter FeedbackManager::Play(): type: [%d], pattern: [%d]",
99+
FT_LOGI("Enter FeedbackManager::Play(): type: [%d], pattern: [%d]",
112100
static_cast<int>(type), static_cast<int>(pattern));
113101

114102
if (ResultCode::kOk != initialization_status_) {
@@ -120,7 +108,6 @@ class FeedbackManager {
120108
auto ret = feedback_play_type(static_cast<feedback_type_e>(type),
121109
static_cast<feedback_pattern_e>(pattern));
122110
if (FEEDBACK_ERROR_NONE == ret) {
123-
FT_LOGD("feedback_play_type() succeeded");
124111
return ResultCode::kOk;
125112
}
126113
FT_LOGE("feedback_play_type() failed with error: [%d] (%s)", ret,
@@ -131,9 +118,6 @@ class FeedbackManager {
131118

132119
private:
133120
static ResultCode NativeErrorToResultCode(int native_error_code) {
134-
FT_LOGD("Enter NativeErrorToResultCode: native_error_code: [%d]",
135-
native_error_code);
136-
137121
switch (native_error_code) {
138122
case FEEDBACK_ERROR_NONE:
139123
return ResultCode::kOk;
@@ -150,30 +134,24 @@ class FeedbackManager {
150134
}
151135

152136
FeedbackManager() {
153-
FT_LOGD("Enter FeedbackManager::FeedbackManager()");
154-
155137
auto ret = feedback_initialize();
156138
if (FEEDBACK_ERROR_NONE != ret) {
157139
FT_LOGE("feedback_initialize() failed with error: [%d] (%s)", ret,
158140
get_error_message(ret));
159141
initialization_status_ = NativeErrorToResultCode(ret);
160142
return;
161143
}
162-
FT_LOGD("feedback_initialize() succeeded");
163144

164145
initialization_status_ = ResultCode::kOk;
165146
}
166147

167148
~FeedbackManager() {
168-
FT_LOGD("Enter FeedbackManager::~FeedbackManager");
169-
170149
auto ret = feedback_deinitialize();
171150
if (FEEDBACK_ERROR_NONE != ret) {
172151
FT_LOGE("feedback_deinitialize() failed with error: [%d] (%s)", ret,
173152
get_error_message(ret));
174153
return;
175154
}
176-
FT_LOGD("feedback_deinitialize() succeeded");
177155
}
178156

179157
ResultCode initialization_status_ = ResultCode::kUnknownError;
@@ -190,8 +168,6 @@ void PlatformChannel::HandleMethodCall(
190168
ui_app_exit();
191169
result->Success();
192170
} else if (method == "SystemSound.play") {
193-
FT_LOGD("SystemSound.play() call received");
194-
195171
const std::string pattern_str = call.arguments()[0].GetString();
196172

197173
const FeedbackManager::FeedbackPattern pattern =
@@ -214,8 +190,6 @@ void PlatformChannel::HandleMethodCall(
214190
result->Error(error_cause, error_message);
215191

216192
} else if (method == "HapticFeedback.vibrate") {
217-
FT_LOGD("HapticFeedback.vibrate() call received");
218-
219193
/*
220194
* We use a single type of vibration (FEEDBACK_PATTERN_SIP) to implement
221195
* HapticFeedback's vibrate, lightImpact, mediumImpact, heavyImpact
@@ -266,15 +240,13 @@ void PlatformChannel::HandleMethodCall(
266240
for (rapidjson::Value::ConstValueIterator itr = list.Begin();
267241
itr != list.End(); ++itr) {
268242
const std::string& rot = itr->GetString();
269-
FT_LOGD("Passed rotation: %s", rot.c_str());
270243
rotations.push_back(orientation_mapping.at(rot));
271244
}
272245
if (rotations.size() == 0) {
273246
// According do docs
274247
// https://api.flutter.dev/flutter/services/SystemChrome/setPreferredOrientations.html
275248
// "The empty list causes the application to defer to the operating
276249
// system default."
277-
FT_LOGD("No rotations passed, using default values");
278250
rotations = {0, 90, 180, 270};
279251
}
280252
renderer_->SetPreferredOrientations(rotations);

shell/platform/tizen/channels/platform_view_channel.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ void PlatformViewChannel::HandleMethodCall(
152152
const auto method = call.method_name();
153153
const auto& arguments = *call.arguments();
154154

155-
FT_LOGD("PlatformViewChannel method: %s", method.c_str());
155+
FT_LOGI("PlatformViewChannel method: %s", method.c_str());
156156
if (method == "create") {
157157
std::string viewType = ExtractStringFromMap(arguments, "viewType");
158158
int viewId = ExtractIntFromMap(arguments, "id");
159159
double width = ExtractDoubleFromMap(arguments, "width");
160160
double height = ExtractDoubleFromMap(arguments, "height");
161161

162-
FT_LOGD(
162+
FT_LOGI(
163163
"PlatformViewChannel create viewType: %s id: %d width: %f height: %f ",
164164
viewType.c_str(), viewId, width, height);
165165

@@ -213,7 +213,6 @@ void PlatformViewChannel::HandleMethodCall(
213213
auto it = view_instances_.find(viewId);
214214
if (viewId >= 0 && it != view_instances_.end()) {
215215
if (method == "dispose") {
216-
FT_LOGD("PlatformViewChannel dispose");
217216
it->second->Dispose();
218217
result->Success();
219218
} else if (method == "resize") {
@@ -254,10 +253,10 @@ void PlatformViewChannel::HandleMethodCall(
254253

255254
result->Success();
256255
} else if (method == "setDirection") {
257-
FT_LOGD("PlatformViewChannel setDirection");
256+
FT_LOGW("PlatformViewChannel setDirection - not implemented");
258257
result->NotImplemented();
259258
} else {
260-
FT_LOGD("Unimplemented method: %s", method.c_str());
259+
FT_LOGW("Unimplemented method: %s", method.c_str());
261260
result->NotImplemented();
262261
}
263262
} else {

shell/platform/tizen/channels/text_input_channel.cc

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void TextInputChannel::InputPanelStateChangedCallback(
144144
void* data,
145145
Ecore_IMF_Context* context,
146146
int value) {
147-
FT_LOGD("Change input panel state[%d]", value);
147+
FT_LOGI("Change input panel state[%d]", value);
148148
if (!data) {
149149
FT_LOGW("No Data");
150150
return;
@@ -178,7 +178,7 @@ void TextInputChannel::InputPanelGeometryChangedCallback(
178178
&self->current_keyboard_geometry_.y, &self->current_keyboard_geometry_.w,
179179
&self->current_keyboard_geometry_.h);
180180

181-
FT_LOGD(
181+
FT_LOGI(
182182
"Current keyboard geometry x:[%d] y:[%d] w:[%d] h:[%d]",
183183
self->current_keyboard_geometry_.x, self->current_keyboard_geometry_.y,
184184
self->current_keyboard_geometry_.w, self->current_keyboard_geometry_.h);
@@ -289,7 +289,7 @@ void TextInputChannel::HandleMethodCall(
289289
std::unique_ptr<flutter::MethodResult<rapidjson::Document>> result) {
290290
const std::string& method = method_call.method_name();
291291

292-
FT_LOGD("Method : %s", method.data());
292+
FT_LOGI("Handle Method : %s", method.data());
293293

294294
if (method.compare(kShowMethod) == 0) {
295295
ShowSoftwareKeyboard();
@@ -395,7 +395,7 @@ void TextInputChannel::SendStateUpdate(const flutter::TextInputModel& model) {
395395
kTextKey, rapidjson::Value(model.GetText(), allocator).Move(), allocator);
396396
args->PushBack(editing_state, allocator);
397397

398-
FT_LOGD("Send text[%s]", model.GetText().data());
398+
FT_LOGI("Send text[%s]", model.GetText().data());
399399
channel_->InvokeMethod(kUpdateEditingStateMethod, std::move(args));
400400
}
401401

@@ -427,7 +427,7 @@ bool TextInputChannel::FilterEvent(Ecore_Event_Key* keyDownEvent) {
427427
if (engine_->device_profile == DeviceProfile::kWearable) {
428428
// FIXME: for wearable
429429
in_select_mode_ = true;
430-
FT_LOGD("Set select mode[true]");
430+
FT_LOGI("Set select mode[true]");
431431
}
432432
}
433433

@@ -447,7 +447,7 @@ bool TextInputChannel::FilterEvent(Ecore_Event_Key* keyDownEvent) {
447447
// of the input panel is shifted to left!
448448
// What we want is to move only the cursor on the text editor.
449449
ResetCurrentContext();
450-
FT_LOGD("Force redirect IME key-event[%s] to fallback",
450+
FT_LOGW("Force redirect IME key-event[%s] to fallback",
451451
keyDownEvent->keyname);
452452
return false;
453453
}
@@ -461,27 +461,27 @@ bool TextInputChannel::FilterEvent(Ecore_Event_Key* keyDownEvent) {
461461
last_handled_ecore_event_keyname_ = keyDownEvent->keyname;
462462
}
463463

464-
FT_LOGD("The %skey-event[%s] are%s filtered", isIME ? "IME " : "",
464+
FT_LOGI("The %skey-event[%s] are%s filtered", isIME ? "IME " : "",
465465
keyDownEvent->keyname, handled ? "" : " not");
466466

467467
if (!handled && !strcmp(keyDownEvent->key, "Return") && in_select_mode_ &&
468468
engine_->device_profile == DeviceProfile::kWearable) {
469469
in_select_mode_ = false;
470470
handled = true;
471-
FT_LOGD("Set select mode[false]");
471+
FT_LOGI("Set select mode[false]");
472472
}
473473

474474
return handled;
475475
}
476476

477477
void TextInputChannel::NonIMFFallback(Ecore_Event_Key* keyDownEvent) {
478-
FT_LOGD("NonIMFFallback key name [%s]", keyDownEvent->keyname);
478+
FT_LOGI("NonIMFFallback key name [%s]", keyDownEvent->keyname);
479479

480480
// For mobile, fix me!
481481
if (engine_->device_profile == DeviceProfile::kMobile &&
482482
edit_status_ == EditStatus::kPreeditEnd) {
483483
SetEditStatus(EditStatus::kNone);
484-
FT_LOGD("Ignore key-event[%s]!", keyDownEvent->keyname);
484+
FT_LOGW("Ignore key-event[%s]!", keyDownEvent->keyname);
485485
return;
486486
}
487487

@@ -548,20 +548,19 @@ void TextInputChannel::EnterPressed(flutter::TextInputModel* model,
548548
}
549549

550550
void TextInputChannel::OnCommit(std::string str) {
551-
FT_LOGD("OnCommit str[%s]", str.data());
551+
FT_LOGI("OnCommit str[%s]", str.data());
552552
SetEditStatus(EditStatus::kCommit);
553553

554554
ConsumeLastPreedit();
555555

556556
active_model_->AddText(str);
557-
FT_LOGD("Add Text[%s]", str.data());
558557

559558
SendStateUpdate(*active_model_);
560559
SetEditStatus(EditStatus::kNone);
561560
}
562561

563562
void TextInputChannel::OnPreedit(std::string str, int cursor_pos) {
564-
FT_LOGD("OnPreedit str[%s], cursor_pos[%d]", str.data(), cursor_pos);
563+
FT_LOGI("OnPreedit str[%s], cursor_pos[%d]", str.data(), cursor_pos);
565564
SetEditStatus(EditStatus::kPreeditStart);
566565
if (str.compare("") == 0) {
567566
SetEditStatus(EditStatus::kPreeditEnd);
@@ -571,8 +570,6 @@ void TextInputChannel::OnPreedit(std::string str, int cursor_pos) {
571570
(edit_status_ == EditStatus::kPreeditEnd &&
572571
// For tv, fix me
573572
last_handled_ecore_event_keyname_.compare("Return") != 0)) {
574-
FT_LOGD("last_handled_ecore_event_keyname_[%s]",
575-
last_handled_ecore_event_keyname_.data());
576573
last_handled_ecore_event_keyname_ = "";
577574
ConsumeLastPreedit();
578575
}
@@ -584,13 +581,13 @@ void TextInputChannel::OnPreedit(std::string str, int cursor_pos) {
584581
preedit_end_pos_ = active_model_->selection().base();
585582
have_preedit_ = true;
586583
SendStateUpdate(*active_model_);
587-
FT_LOGD("preedit start pos[%d], preedit end pos[%d]", preedit_start_pos_,
584+
FT_LOGI("preedit start pos[%d], preedit end pos[%d]", preedit_start_pos_,
588585
preedit_end_pos_);
589586
}
590587
}
591588
void TextInputChannel::OnPreeditForPlatformView(std::string str,
592589
int cursor_pos) {
593-
FT_LOGD("OnPreeditForPlatformView str[%s], cursor_pos[%d]", str.data(),
590+
FT_LOGI("OnPreeditForPlatformView str[%s], cursor_pos[%d]", str.data(),
594591
cursor_pos);
595592

596593
SetEditStatus(EditStatus::kPreeditStart);
@@ -602,8 +599,6 @@ void TextInputChannel::OnPreeditForPlatformView(std::string str,
602599
(edit_status_ == EditStatus::kPreeditEnd &&
603600
// For tv, fix me
604601
last_handled_ecore_event_keyname_.compare("Return") != 0)) {
605-
FT_LOGD("last_handled_ecore_event_keyname_[%s]",
606-
last_handled_ecore_event_keyname_.data());
607602
last_handled_ecore_event_keyname_ = "";
608603
}
609604

@@ -614,7 +609,6 @@ void TextInputChannel::OnPreeditForPlatformView(std::string str,
614609
}
615610

616611
void TextInputChannel::ShowSoftwareKeyboard() {
617-
FT_LOGD("Show input panel");
618612
if (imf_context_ && !is_software_keyboard_showing_) {
619613
is_software_keyboard_showing_ = true;
620614
Ecore_IMF_Input_Panel_Layout panel_layout;
@@ -627,7 +621,6 @@ void TextInputChannel::ShowSoftwareKeyboard() {
627621
}
628622

629623
void TextInputChannel::HideSoftwareKeyboard() {
630-
FT_LOGD("Hide input panel");
631624
if (imf_context_ && is_software_keyboard_showing_) {
632625
is_software_keyboard_showing_ = false;
633626
ResetCurrentContext();
@@ -636,7 +629,6 @@ void TextInputChannel::HideSoftwareKeyboard() {
636629
}
637630

638631
void TextInputChannel::SetEditStatus(EditStatus edit_status) {
639-
FT_LOGD("Set edit status[%d]", edit_status);
640632
edit_status_ = edit_status;
641633
}
642634

@@ -699,7 +691,7 @@ void TextInputChannel::ConsumeLastPreedit() {
699691
int count = preedit_end_pos_ - preedit_start_pos_;
700692
active_model_->DeleteSurrounding(-count, count);
701693
std::string after = active_model_->GetText();
702-
FT_LOGD("Consume last preedit count:[%d] text:[%s] -> [%s]", count,
694+
FT_LOGI("Consume last preedit count:[%d] text:[%s] -> [%s]", count,
703695
before.data(), after.data());
704696
SendStateUpdate(*active_model_);
705697
}

0 commit comments

Comments
 (0)