Skip to content

Commit 022b7c3

Browse files
authored
Introduce assertion macros (flutter-tizen#17)
* Macros must consist of uppercase letters * Prefix "FT" means "Flutter-Tizen" * Tidy up minor things Signed-off-by: Boram Bae <[email protected]>
1 parent dad9f69 commit 022b7c3

17 files changed

+245
-205
lines changed

shell/platform/tizen/channels/key_event_channel.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <map>
88

9-
#include "flutter/shell/platform/tizen/logger.h"
9+
#include "flutter/shell/platform/tizen/tizen_log.h"
1010

1111
static constexpr char kChannelName[] = "flutter/keyevent";
1212

@@ -221,7 +221,7 @@ KeyEventChannel::KeyEventChannel(flutter::BinaryMessenger* messenger)
221221
KeyEventChannel::~KeyEventChannel() {}
222222

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

227227
int gtk_keycode = 0;

shell/platform/tizen/channels/lifecycle_channel.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "lifecycle_channel.h"
66

7-
#include "flutter/shell/platform/tizen/logger.h"
7+
#include "flutter/shell/platform/tizen/tizen_log.h"
88

99
static constexpr char kChannelName[] = "flutter/lifecycle";
1010
static constexpr char kInactive[] = "AppLifecycleState.inactive";
@@ -29,21 +29,21 @@ void LifecycleChannel::SendLifecycleMessage(const char message[]) {
2929
}
3030

3131
void LifecycleChannel::AppIsInactive() {
32-
LoggerD("send app lifecycle state inactive.");
32+
FT_LOGD("send app lifecycle state inactive.");
3333
SendLifecycleMessage(kInactive);
3434
}
3535

3636
void LifecycleChannel::AppIsResumed() {
37-
LoggerD("send app lifecycle state resumed.");
37+
FT_LOGD("send app lifecycle state resumed.");
3838
SendLifecycleMessage(kResumed);
3939
}
4040

4141
void LifecycleChannel::AppIsPaused() {
42-
LoggerD("send app lifecycle state paused.");
42+
FT_LOGD("send app lifecycle state paused.");
4343
SendLifecycleMessage(kPaused);
4444
}
4545

4646
void LifecycleChannel::AppIsDetached() {
47-
LoggerD("send app lifecycle state detached.");
47+
FT_LOGD("send app lifecycle state detached.");
4848
SendLifecycleMessage(kDetached);
4949
}

shell/platform/tizen/channels/localization_channel.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <vector>
1010

11-
#include "flutter/shell/platform/tizen/logger.h"
11+
#include "flutter/shell/platform/tizen/tizen_log.h"
1212
#include "rapidjson/document.h"
1313
#include "rapidjson/writer.h"
1414

@@ -51,13 +51,13 @@ void LocalizationChannel::SendPlatformResolvedLocale() {
5151
const char* locale;
5252
int ret = i18n_ulocale_get_default(&locale);
5353
if (ret != I18N_ERROR_NONE) {
54-
LoggerE("i18n_ulocale_get_default() failed.");
54+
FT_LOGE("i18n_ulocale_get_default() failed.");
5555
return;
5656
}
5757

5858
FlutterLocale* flutterLocale = GetFlutterLocale(locale);
5959
if (!flutterLocale) {
60-
LoggerE("Language code is required but not present.");
60+
FT_LOGE("Language code is required but not present.");
6161
return;
6262
}
6363

@@ -88,7 +88,7 @@ void LocalizationChannel::SendPlatformResolvedLocale() {
8888
rapidjson::StringBuffer buffer;
8989
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
9090
if (!document.Accept(writer)) {
91-
LoggerE("document.Accept failed!");
91+
FT_LOGE("document.Accept failed!");
9292
return;
9393
}
9494

@@ -120,7 +120,7 @@ FlutterLocale* LocalizationChannel::GetFlutterLocale(const char* locale) {
120120
memcpy(language, buffer, bufSize);
121121
language[bufSize] = '\0';
122122
} else {
123-
LoggerE("i18n_ulocale_get_language failed!");
123+
FT_LOGE("i18n_ulocale_get_language failed!");
124124
return nullptr;
125125
}
126126

shell/platform/tizen/channels/platform_channel.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <app.h>
88

99
#include "flutter/shell/platform/common/cpp/json_method_codec.h"
10-
#include "flutter/shell/platform/tizen/logger.h"
10+
#include "flutter/shell/platform/tizen/tizen_log.h"
1111

1212
static constexpr char kChannelName[] = "flutter/platform";
1313

@@ -53,7 +53,7 @@ void PlatformChannel::HandleMethodCall(
5353
} else if (method == "SystemChrome.setSystemUIOverlayStyle") {
5454
result->NotImplemented();
5555
} else {
56-
LoggerI("Unimplemented method: %s", method.c_str());
56+
FT_LOGI("Unimplemented method: %s", method.c_str());
5757
result->NotImplemented();
5858
}
5959
}

shell/platform/tizen/channels/platform_view_channel.cc

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#include "flutter/shell/platform/common/cpp/client_wrapper/include/flutter/standard_message_codec.h"
88
#include "flutter/shell/platform/common/cpp/client_wrapper/include/flutter/standard_method_codec.h"
99
#include "flutter/shell/platform/common/cpp/json_method_codec.h"
10-
#include "flutter/shell/platform/tizen/logger.h"
1110
#include "flutter/shell/platform/tizen/public/flutter_platform_view.h"
11+
#include "flutter/shell/platform/tizen/tizen_log.h"
1212

1313
static constexpr char kChannelName[] = "flutter/platform_views";
1414

@@ -122,7 +122,7 @@ void PlatformViewChannel::HandleMethodCall(
122122
double width = ExtractDoubleFromMap(arguments, "width");
123123
double height = ExtractDoubleFromMap(arguments, "height");
124124

125-
LoggerD(
125+
FT_LOGD(
126126
"PlatformViewChannel create viewType: %s id: %d width: %f height: %f ",
127127
viewType.c_str(), viewId, width, height);
128128

@@ -152,19 +152,19 @@ void PlatformViewChannel::HandleMethodCall(
152152

153153
result->Success(flutter::EncodableValue(viewInstance->GetTextureId()));
154154
} else {
155-
LoggerE("can't find view type = %s", viewType.c_str());
155+
FT_LOGE("can't find view type = %s", viewType.c_str());
156156
result->Error("0", "can't find view type");
157157
}
158158
} else {
159159
int viewId = ExtractIntFromMap(arguments, "id");
160160
auto it = view_instances_.find(viewId);
161161
if (viewId >= 0 && it != view_instances_.end()) {
162162
if (method == "dispose") {
163-
LoggerD("PlatformViewChannel dispose");
163+
FT_LOGD("PlatformViewChannel dispose");
164164
it->second->Dispose();
165165
result->Success();
166166
} else if (method == "resize") {
167-
LoggerD("PlatformViewChannel resize");
167+
FT_LOGD("PlatformViewChannel resize");
168168
double width = ExtractDoubleFromMap(arguments, "width");
169169
double height = ExtractDoubleFromMap(arguments, "height");
170170
it->second->Resize(width, height);
@@ -188,18 +188,18 @@ void PlatformViewChannel::HandleMethodCall(
188188
it->second->Touch(type, button, x, y, dx, dy);
189189
result->Success();
190190
} else if (method == "setDirection") {
191-
LoggerD("PlatformViewChannel setDirection");
191+
FT_LOGD("PlatformViewChannel setDirection");
192192
result->NotImplemented();
193193
} else if (method == "clearFocus") {
194-
LoggerD("PlatformViewChannel clearFocus");
194+
FT_LOGD("PlatformViewChannel clearFocus");
195195
it->second->ClearFocus();
196196
result->NotImplemented();
197197
} else {
198-
LoggerD("Unimplemented method: %s", method.c_str());
198+
FT_LOGD("Unimplemented method: %s", method.c_str());
199199
result->NotImplemented();
200200
}
201201
} else {
202-
LoggerE("can't find view id");
202+
FT_LOGE("can't find view id");
203203
result->Error("0", "can't find view id");
204204
}
205205
}

0 commit comments

Comments
 (0)