Fix incorrect FML_VLOG() severity usage (#50118)
The FML_VLOG() macros are designed to use a positive integers, since
they pass -severity to the LogMessage constructor. The negative severity
can also cause some surprising behavior with log filtering. This change
update usages of FML_VLOG(-1) to FML_VLOG(1).
flutter/flutter#141924
diff --git a/shell/platform/fuchsia/flutter/component_v2.cc b/shell/platform/fuchsia/flutter/component_v2.cc
index 05788f6..7e6ffab 100644
--- a/shell/platform/fuchsia/flutter/component_v2.cc
+++ b/shell/platform/fuchsia/flutter/component_v2.cc
@@ -545,7 +545,7 @@
}
void ComponentV2::Kill() {
- FML_VLOG(-1) << "received Kill event";
+ FML_VLOG(1) << "received Kill event";
// From the documentation for ComponentController, ZX_OK should be sent when
// the ComponentController receives a termination request. However, if the
@@ -582,7 +582,7 @@
}
void ComponentV2::Stop() {
- FML_VLOG(-1) << "received Stop event";
+ FML_VLOG(1) << "received Stop event";
// TODO(fxb/89162): Any other cleanup logic we should do that's appropriate
// for Stop but not for Kill?
@@ -617,8 +617,8 @@
shell_holders_.erase(found);
if (shell_holders_.empty()) {
- FML_VLOG(-1) << "Killing component because all shell holders have been "
- "terminated.";
+ FML_VLOG(1) << "Killing component because all shell holders have been "
+ "terminated.";
Kill();
// WARNING: Don't do anything past this point because the delegate may have
// collected this instance via the termination callback.
diff --git a/shell/platform/fuchsia/flutter/engine.cc b/shell/platform/fuchsia/flutter/engine.cc
index 9aaddd2..d0893a7 100644
--- a/shell/platform/fuchsia/flutter/engine.cc
+++ b/shell/platform/fuchsia/flutter/engine.cc
@@ -611,7 +611,7 @@
ZX_ASSERT(runner_services->Connect(
memory_pressure_provider_.NewRequest()) == ZX_OK);
- FML_VLOG(-1) << "Registering memorypressure watcher";
+ FML_VLOG(1) << "Registering memorypressure watcher";
// Register for changes, which will make the request for the initial
// memory level.
@@ -647,12 +647,12 @@
FML_LOG(WARNING) << "Got intl Profile without locales";
}
auto message = MakeLocalizationPlatformMessage(profile);
- FML_VLOG(-1) << "Sending LocalizationPlatformMessage";
+ FML_VLOG(1) << "Sending LocalizationPlatformMessage";
weak->shell_->GetPlatformView()->DispatchPlatformMessage(
std::move(message));
};
- FML_VLOG(-1) << "Requesting intl Profile";
+ FML_VLOG(1) << "Requesting intl Profile";
// Make the initial request
intl_property_provider_->GetProfile(get_profile_callback);
@@ -660,7 +660,7 @@
// And register for changes
intl_property_provider_.events().OnChange = [this, runner_services,
get_profile_callback]() {
- FML_VLOG(-1) << fuchsia::intl::PropertyProvider::Name_ << ": OnChange";
+ FML_VLOG(1) << fuchsia::intl::PropertyProvider::Name_ << ": OnChange";
runner_services->Connect(intl_property_provider_.NewRequest());
intl_property_provider_->GetProfile(get_profile_callback);
};
diff --git a/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc b/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc
index 6135912..db875cf 100644
--- a/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc
+++ b/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc
@@ -114,7 +114,7 @@
public:
FlutterEmbedderTest()
: realm_builder_(component_testing::RealmBuilder::Create()) {
- FML_VLOG(-1) << "Setting up base realm";
+ FML_VLOG(1) << "Setting up base realm";
SetUpRealmBase();
// Post a "just in case" quit task, if the test hangs.