From c38bef8bc2e0a5d93c0fc15b246a8bc5b0373990 Mon Sep 17 00:00:00 2001 From: iuriionishchenko <136322748+iuriionishchenko@users.noreply.github.com> Date: Wed, 22 May 2024 05:01:25 +0300 Subject: [PATCH] Replace starboard/common/log with base/logging in the common source files (#3038) Replace starboard/common/log with base/logging in the common source files b/322248899 Change-Id: Idf38e7e48f7583778b1a06e069926b6427272af2 (cherry picked from commit 872499282aaaeb9601854e515df78265d72c980c) --- base/time/time_unittest.cc | 3 +- cobalt/audio/audio_destination_node.cc | 9 ++-- cobalt/audio/audio_file_reader_wav.cc | 26 +++++----- cobalt/base/localized_strings.cc | 2 +- cobalt/bindings/testing/date_bindings_test.cc | 4 +- cobalt/browser/browser_module.cc | 2 +- .../memory_settings/pretty_print_test.cc | 3 +- .../memory_settings/table_printer_test.cc | 4 +- cobalt/browser/suspend_fuzzer.cc | 5 +- cobalt/dom/on_screen_keyboard_test.cc | 3 +- cobalt/h5vcc/h5vcc_platform_service.cc | 3 +- cobalt/js_profiler/profiler.cc | 6 +-- cobalt/media/sandbox/format_guesstimator.cc | 3 +- .../media/sandbox/web_media_player_sandbox.cc | 15 +++--- .../renderer/backend/graphics_system_test.cc | 29 ++++++------ .../get_default_rasterizer_for_platform.cc | 3 +- cobalt/renderer/rasterizer/pixel_test.cc | 3 +- .../skia/skia/src/ports/SkFontMgr_cobalt.cc | 9 ++-- cobalt/speech/speech_synthesis.cc | 5 +- cobalt/system_window/system_window.cc | 2 +- cobalt/watchdog/instrumentation_log.cc | 4 +- cobalt/watchdog/watchdog.cc | 47 +++++++++---------- cobalt/web/navigator_ua_data.cc | 3 +- cobalt/xhr/url_fetcher_buffer_writer.cc | 8 ++-- components/crx_file/crx_verifier.cc | 2 +- 25 files changed, 109 insertions(+), 94 deletions(-) diff --git a/base/time/time_unittest.cc b/base/time/time_unittest.cc index d1d190fcbf2b..991227d12791 100644 --- a/base/time/time_unittest.cc +++ b/base/time/time_unittest.cc @@ -15,6 +15,7 @@ #include "base/check_op.h" #include "base/compiler_specific.h" #include "base/environment.h" +#include "base/logging.h" #include "base/test/gtest_util.h" #include "base/threading/platform_thread.h" #include "base/time/time_override.h" @@ -1486,7 +1487,7 @@ ThreadTicks ThreadTicksOverride::now_ticks_; #endif TEST(ThreadTicks, MAYBE_NowOverride) { if (starboard::CurrentMonotonicThreadTime() == 0) { - SB_LOG(INFO) << "Time thread now not supported. Test skipped."; + LOG(INFO) << "Time thread now not supported. Test skipped."; return; } diff --git a/cobalt/audio/audio_destination_node.cc b/cobalt/audio/audio_destination_node.cc index 9c1c5fa1eee1..24cc4211c639 100644 --- a/cobalt/audio/audio_destination_node.cc +++ b/cobalt/audio/audio_destination_node.cc @@ -14,6 +14,7 @@ #include "cobalt/audio/audio_destination_node.h" +#include "base/logging.h" #include "cobalt/audio/audio_context.h" namespace cobalt { @@ -59,7 +60,7 @@ void AudioDestinationNode::OnInputNodeConnected() { if (!audio_device_) { audio_device_.reset( new AudioDevice(static_cast(channel_count(NULL)), this)); - SB_LOG(INFO) << "Created audio device " << audio_device_.get() << '.'; + LOG(INFO) << "Created audio device " << audio_device_.get() << '.'; context()->PreventGarbageCollection(); } delete_audio_device_ = false; @@ -79,8 +80,8 @@ void AudioDestinationNode::FillAudioBus(bool all_consumed, AudioBus* audio_bus, bool all_finished = true; Input(0)->FillAudioBus(audio_bus, silence, &all_finished); if (all_consumed && all_finished) { - SB_LOG(INFO) << "Schedule to destroy audio device " << audio_device_.get() - << '.'; + LOG(INFO) << "Schedule to destroy audio device " << audio_device_.get() + << '.'; delete_audio_device_ = true; task_runner_->PostTask(FROM_HERE, base::Bind(&AudioDestinationNode::DestroyAudioDevice, @@ -94,7 +95,7 @@ void AudioDestinationNode::DestroyAudioDevice() { return; } if (delete_audio_device_) { - SB_LOG(INFO) << "Destroying audio device " << audio_device_.get() << '.'; + LOG(INFO) << "Destroying audio device " << audio_device_.get() << '.'; audio_device_.reset(); context()->AllowGarbageCollection(); delete_audio_device_ = false; diff --git a/cobalt/audio/audio_file_reader_wav.cc b/cobalt/audio/audio_file_reader_wav.cc index ea8aa97f3e76..d5534cbff587 100644 --- a/cobalt/audio/audio_file_reader_wav.cc +++ b/cobalt/audio/audio_file_reader_wav.cc @@ -213,12 +213,12 @@ void AudioFileReaderWAV::ParseWAV_data(const uint8* data, size_t offset, #if SB_IS(LITTLE_ENDIAN) if ((!is_src_sample_in_float && sample_type_ == kSampleTypeInt16) || (is_src_sample_in_float && sample_type_ == kSampleTypeFloat32)) { - SB_LOG(INFO) << "Copying " << size << " bytes of wav data."; + LOG(INFO) << "Copying " << size << " bytes of wav data."; memcpy(audio_bus_->interleaved_data(), data + offset, size); } else if (!is_src_sample_in_float && sample_type_ == kSampleTypeFloat32) { // Convert from int16 to float32 - SB_LOG(INFO) << "Converting " << number_of_frames_ * number_of_channels_ - << " samples from int16 to float32."; + LOG(INFO) << "Converting " << number_of_frames_ * number_of_channels_ + << " samples from int16 to float32."; const int16* src_samples = reinterpret_cast(data + offset); float* dest_samples = reinterpret_cast(audio_bus_->interleaved_data()); @@ -230,8 +230,8 @@ void AudioFileReaderWAV::ParseWAV_data(const uint8* data, size_t offset, } } else { // Convert from float32 to int16 - SB_LOG(INFO) << "Converting " << number_of_frames_ * number_of_channels_ - << " samples from float32 to int16."; + LOG(INFO) << "Converting " << number_of_frames_ * number_of_channels_ + << " samples from float32 to int16."; const float* src_samples = reinterpret_cast(data + offset); int16* dest_samples = reinterpret_cast(audio_bus_->interleaved_data()); @@ -244,8 +244,8 @@ void AudioFileReaderWAV::ParseWAV_data(const uint8* data, size_t offset, } #else // SB_IS(LITTLE_ENDIAN) if (!is_src_sample_in_float && sample_type_ == kSampleTypeInt16) { - SB_LOG(INFO) << "Converting " << number_of_frames_ * number_of_channels_ - << " int16 samples from little endian to big endian."; + LOG(INFO) << "Converting " << number_of_frames_ * number_of_channels_ + << " int16 samples from little endian to big endian."; const uint8_t* src_samples = data + offset; int16* dest_samples = reinterpret_cast(audio_bus_->interleaved_data()); @@ -255,8 +255,8 @@ void AudioFileReaderWAV::ParseWAV_data(const uint8* data, size_t offset, ++dest_samples; } } else if (is_src_sample_in_float && sample_type_ == kSampleTypeFloat32) { - SB_LOG(INFO) << "Converting " << number_of_frames_ * number_of_channels_ - << " float32 samples from little endian to big endian."; + LOG(INFO) << "Converting " << number_of_frames_ * number_of_channels_ + << " float32 samples from little endian to big endian."; const uint8_t* src_samples = data + offset; float* dest_samples = reinterpret_cast(audio_bus_->interleaved_data()); @@ -268,8 +268,8 @@ void AudioFileReaderWAV::ParseWAV_data(const uint8* data, size_t offset, } } else if (!is_src_sample_in_float && sample_type_ == kSampleTypeFloat32) { // Convert from int16 to float32 - SB_LOG(INFO) << "Converting " << number_of_frames_ * number_of_channels_ - << " int16 samples in little endian to float32 in big endian."; + LOG(INFO) << "Converting " << number_of_frames_ * number_of_channels_ + << " int16 samples in little endian to float32 in big endian."; const uint8_t* src_samples = data + offset; float* dest_samples = reinterpret_cast(audio_bus_->interleaved_data()); @@ -281,8 +281,8 @@ void AudioFileReaderWAV::ParseWAV_data(const uint8* data, size_t offset, } } else { // Convert from float32 to int16 - SB_LOG(INFO) << "Converting " << number_of_frames_ * number_of_channels_ - << " float32 samples in little endian to int16 in big endian."; + LOG(INFO) << "Converting " << number_of_frames_ * number_of_channels_ + << " float32 samples in little endian to int16 in big endian."; const uint8_t* src_samples = data + offset; int16* dest_samples = reinterpret_cast(audio_bus_->interleaved_data()); diff --git a/cobalt/base/localized_strings.cc b/cobalt/base/localized_strings.cc index 05b41e06ad51..ee99793be9e3 100644 --- a/cobalt/base/localized_strings.cc +++ b/cobalt/base/localized_strings.cc @@ -114,7 +114,7 @@ bool LocalizedStrings::LoadSingleString(const std::string& message) { // A single message is a key/value pair with separator. size_t separator_pos = message.find(';'); if (separator_pos == std::string::npos) { - SB_DLOG(ERROR) << "No separator found in: " << message; + DLOG(ERROR) << "No separator found in: " << message; return false; } diff --git a/cobalt/bindings/testing/date_bindings_test.cc b/cobalt/bindings/testing/date_bindings_test.cc index 00048e2743ee..d96ddbfadbed 100644 --- a/cobalt/bindings/testing/date_bindings_test.cc +++ b/cobalt/bindings/testing/date_bindings_test.cc @@ -91,8 +91,8 @@ TEST_F(DateBindingsTest, StarboardTimeZone) { EvaluateScript("new Date().toString();", &result); base::Time now = base::Time::Now(); - SB_LOG(INFO) << "JavaScript Date now is : " << result; - SB_LOG(INFO) << "and base::Time is: " << now; + LOG(INFO) << "JavaScript Date now is : " << result; + LOG(INFO) << "and base::Time is: " << now; base::Time::Exploded exploded; now.LocalExplode(&exploded); diff --git a/cobalt/browser/browser_module.cc b/cobalt/browser/browser_module.cc index 5e5c7da3cdfc..c4d69c0861c1 100644 --- a/cobalt/browser/browser_module.cc +++ b/cobalt/browser/browser_module.cc @@ -1714,7 +1714,7 @@ void BrowserModule::OnPollForRenderTimeout(const GURL& url) { kRenderTimeoutErrorPercentage * (UINT64_MAX / 100)) { OnError(url, std::string("Rendering Timeout")); } else { - SB_DLOG(INFO) << "Received OnRenderTimeout, ignoring by random chance."; + DLOG(INFO) << "Received OnRenderTimeout, ignoring by random chance."; } } else { timeout_polling_thread_.task_runner()->PostDelayedTask( diff --git a/cobalt/browser/memory_settings/pretty_print_test.cc b/cobalt/browser/memory_settings/pretty_print_test.cc index d8bba3c0da3d..ba28b4adb812 100644 --- a/cobalt/browser/memory_settings/pretty_print_test.cc +++ b/cobalt/browser/memory_settings/pretty_print_test.cc @@ -23,6 +23,7 @@ #include #include "base/command_line.h" +#include "base/logging.h" #include "cobalt/browser/memory_settings/memory_settings.h" #include "cobalt/browser/memory_settings/test_common.h" #include "cobalt/browser/switches.h" @@ -46,7 +47,7 @@ bool HasTokensInOrder(const std::string& value, EXPECT_NE(position, std::string::npos); EXPECT_GE(position, current_position); if (position == std::string::npos) { - SB_DLOG(INFO) << "Token \"" << token << "\" not found in order."; + DLOG(INFO) << "Token \"" << token << "\" not found in order."; return false; } current_position = position + strlen(token); diff --git a/cobalt/browser/memory_settings/table_printer_test.cc b/cobalt/browser/memory_settings/table_printer_test.cc index 8c01b4dccaa4..d31349603ca4 100644 --- a/cobalt/browser/memory_settings/table_printer_test.cc +++ b/cobalt/browser/memory_settings/table_printer_test.cc @@ -16,7 +16,7 @@ #include "cobalt/browser/memory_settings/table_printer.h" -#include "starboard/common/log.h" +#include "base/logging.h" #include "starboard/string.h" #include "testing/gtest/include/gtest/gtest.h" @@ -46,7 +46,7 @@ bool HasTokensInOrder(const std::string& value, EXPECT_NE(position, std::string::npos); EXPECT_GE(position, current_position); if (position == std::string::npos) { - SB_DLOG(INFO) << "Token \"" << token << "\" not found in order."; + DLOG(INFO) << "Token \"" << token << "\" not found in order."; return false; } current_position = position + strlen(token); diff --git a/cobalt/browser/suspend_fuzzer.cc b/cobalt/browser/suspend_fuzzer.cc index c3bb35830007..97a6247247ce 100644 --- a/cobalt/browser/suspend_fuzzer.cc +++ b/cobalt/browser/suspend_fuzzer.cc @@ -14,6 +14,7 @@ #include "cobalt/browser/suspend_fuzzer.h" +#include "base/logging.h" #include "base/threading/thread_task_runner_handle.h" namespace cobalt { @@ -47,11 +48,11 @@ void SuspendFuzzer::DoStep() { DCHECK(base::SequencedTaskRunner::GetCurrentDefault() == thread_.task_runner()); if (step_type_ == kShouldRequestFreeze) { - SB_DLOG(INFO) << "suspend_fuzzer: Requesting freeze."; + DLOG(INFO) << "suspend_fuzzer: Requesting freeze."; SbSystemRequestFreeze(); step_type_ = kShouldRequestFocus; } else if (step_type_ == kShouldRequestFocus) { - SB_DLOG(INFO) << "suspend_fuzzer: Requesting focus."; + DLOG(INFO) << "suspend_fuzzer: Requesting focus."; SbSystemRequestFocus(); step_type_ = kShouldRequestFocus; } else { diff --git a/cobalt/dom/on_screen_keyboard_test.cc b/cobalt/dom/on_screen_keyboard_test.cc index d2ce2a380661..d0ef8aa28aaf 100644 --- a/cobalt/dom/on_screen_keyboard_test.cc +++ b/cobalt/dom/on_screen_keyboard_test.cc @@ -15,6 +15,7 @@ #include #include +#include "base/logging.h" #include "cobalt/base/tokens.h" #include "cobalt/bindings/testing/utils.h" #include "cobalt/browser/on_screen_keyboard_extension_bridge.h" @@ -203,7 +204,7 @@ class OnScreenKeyboardTest : public testing::TestWithJavaScript { bool SkipLocale() { bool skipTests = !browser::OnScreenKeyboardExtensionBridge::IsSupported(); if (skipTests) { - SB_LOG(INFO) << "On screen keyboard not supported. Test skipped."; + LOG(INFO) << "On screen keyboard not supported. Test skipped."; } return skipTests; } diff --git a/cobalt/h5vcc/h5vcc_platform_service.cc b/cobalt/h5vcc/h5vcc_platform_service.cc index 96be634e0848..a76add18d9d8 100644 --- a/cobalt/h5vcc/h5vcc_platform_service.cc +++ b/cobalt/h5vcc/h5vcc_platform_service.cc @@ -17,6 +17,7 @@ #include #include +#include "base/logging.h" #include "base/threading/thread_task_runner_handle.h" #include "cobalt/base/polymorphic_downcast.h" #include "cobalt/web/context.h" @@ -42,7 +43,7 @@ scoped_refptr H5vccPlatformService::Open( static_cast( SbSystemGetExtension(kCobaltExtensionPlatformServiceName)); if (!platform_service_api) { - SB_DLOG(WARNING) << "PlatformService is not implemented on this platform."; + DLOG(WARNING) << "PlatformService is not implemented on this platform."; return NULL; } scoped_refptr service = new H5vccPlatformService( diff --git a/cobalt/js_profiler/profiler.cc b/cobalt/js_profiler/profiler.cc index bf3f8e9ce5bb..5918386038b6 100644 --- a/cobalt/js_profiler/profiler.cc +++ b/cobalt/js_profiler/profiler.cc @@ -56,7 +56,7 @@ Profiler::Profiler(script::EnvironmentSettings* settings, } sample_interval_ = effective_sample_interval_ms; - SB_LOG(INFO) << "[PROFILER] START " + profiler_id_; + LOG(INFO) << "[PROFILER] START " + profiler_id_; auto status = profiler_group_->ProfilerStart( this, settings, v8::CpuProfilingOptions(v8::kLeafNodeLineNumbers, @@ -95,7 +95,7 @@ void Profiler::DispatchSampleBufferFullEvent() { Profiler::ProfilerTracePromise Profiler::Stop( script::EnvironmentSettings* environment_settings) { - SB_LOG(INFO) << "[PROFILER] STOPPING " + profiler_id_; + LOG(INFO) << "[PROFILER] STOPPING " + profiler_id_; script::HandlePromiseWrappable promise = web::get_script_value_factory(environment_settings) ->CreateInterfacePromise>(); @@ -123,7 +123,7 @@ void Profiler::PerformStop( ProfilerGroup* profiler_group, std::unique_ptr promise_reference, base::TimeTicks time_origin, std::string profiler_id) { - SB_LOG(INFO) << "[PROFILER] STOPPED " + profiler_id_; + LOG(INFO) << "[PROFILER] STOPPED " + profiler_id_; auto trace = profiler_group->ProfilerStop(this); scoped_refptr result(new ProfilerTraceWrapper(trace)); promise_reference->value().Resolve(result); diff --git a/cobalt/media/sandbox/format_guesstimator.cc b/cobalt/media/sandbox/format_guesstimator.cc index 5a9fe6074979..b92512a33aca 100644 --- a/cobalt/media/sandbox/format_guesstimator.cc +++ b/cobalt/media/sandbox/format_guesstimator.cc @@ -19,6 +19,7 @@ #include #include "base/bind.h" +#include "base/logging.h" #include "base/path_service.h" #include "base/run_loop.h" #include "base/strings/string_split.h" @@ -153,7 +154,7 @@ FormatGuesstimator::FormatGuesstimator(const std::string& path_or_url, bool is_from_root = !path_or_url.empty() && path_or_url[0] == '/'; auto path_from_root = (is_from_root ? "" : "/") + path_or_url; progressive_url_ = GURL("file://" + path_from_root); - SB_LOG(INFO) << progressive_url_.spec(); + LOG(INFO) << progressive_url_.spec(); mime_type_ = "video/mp4; codecs=\"avc1.640028, mp4a.40.2\""; } } diff --git a/cobalt/media/sandbox/web_media_player_sandbox.cc b/cobalt/media/sandbox/web_media_player_sandbox.cc index 600e47566103..71cefdbd106b 100644 --- a/cobalt/media/sandbox/web_media_player_sandbox.cc +++ b/cobalt/media/sandbox/web_media_player_sandbox.cc @@ -21,6 +21,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/compiler_specific.h" +#include "base/logging.h" #include "base/memory/ref_counted.h" #include "base/path_service.h" #include "base/task/sequenced_task_runner.h" @@ -120,7 +121,7 @@ class Application { media_sandbox_.GetMediaModule()); if (!guesstimator1.is_valid()) { - SB_LOG(ERROR) << "Invalid path or url: " << argv[argc - 1]; + LOG(ERROR) << "Invalid path or url: " << argv[argc - 1]; // Fall off to PrintUsage() and terminate. } else if (guesstimator1.is_progressive()) { InitializeProgressivePlayback(guesstimator1); @@ -129,14 +130,14 @@ class Application { InitializeAdaptivePlayback(guesstimator1); return; } else if (guesstimator1.is_audio() && guesstimator2.is_audio()) { - SB_LOG(ERROR) << "Failed to play because both " << argv[argc - 1] - << " and " << argv[argc - 2] - << " are audio streams, check usage for more details."; + LOG(ERROR) << "Failed to play because both " << argv[argc - 1] + << " and " << argv[argc - 2] + << " are audio streams, check usage for more details."; // Fall off to PrintUsage() and terminate. } else if (!guesstimator1.is_audio() && !guesstimator2.is_audio()) { - SB_LOG(ERROR) << "Failed to play because both " << argv[argc - 1] - << " and " << argv[argc - 2] - << " are video streams, check usage for more details."; + LOG(ERROR) << "Failed to play because both " << argv[argc - 1] + << " and " << argv[argc - 2] + << " are video streams, check usage for more details."; // Fall off to PrintUsage() and terminate. } else if (guesstimator1.is_audio()) { InitializeAdaptivePlayback(guesstimator1, guesstimator2); diff --git a/cobalt/renderer/backend/graphics_system_test.cc b/cobalt/renderer/backend/graphics_system_test.cc index 0100fc9fb4e4..62297535c097 100644 --- a/cobalt/renderer/backend/graphics_system_test.cc +++ b/cobalt/renderer/backend/graphics_system_test.cc @@ -17,6 +17,7 @@ #include #include +#include "base/logging.h" #include "base/optional.h" #include "base/time/time.h" #include "cobalt/renderer/backend/default_graphics_system.h" @@ -51,10 +52,10 @@ TEST(GraphicsSystemTest, FLAKY_GraphicsSystemCanBeInitializedOften) { } int64_t time_per_initialization_usec = (starboard::CurrentMonotonicTime() - start) / kReferenceCount; - SB_LOG(INFO) << "Measured duration " - << time_per_initialization_usec / - base::Time::kMicrosecondsPerMillisecond - << "ms per initialization."; + LOG(INFO) << "Measured duration " + << time_per_initialization_usec / + base::Time::kMicrosecondsPerMillisecond + << "ms per initialization."; // Graphics system initializations should not take more than the maximum of // 250ms or three times as long as the time we just measured. @@ -68,9 +69,9 @@ TEST(GraphicsSystemTest, FLAKY_GraphicsSystemCanBeInitializedOften) { graphics_system.reset(); int64_t now = starboard::CurrentMonotonicTime(); int64_t elapsed_time_usec = now - last; - SB_LOG(INFO) << "Test duration " - << elapsed_time_usec / base::Time::kMicrosecondsPerMillisecond - << "ms."; + LOG(INFO) << "Test duration " + << elapsed_time_usec / base::Time::kMicrosecondsPerMillisecond + << "ms."; ASSERT_LT(elapsed_time_usec, maximum_time_usec_per_initialization); last = now; } @@ -100,10 +101,10 @@ TEST(GraphicsSystemTest, FLAKY_GraphicsContextCanBeInitializedOften) { int64_t time_per_initialization_usec = base::Time::kMicrosecondsPerMillisecond + (starboard::CurrentMonotonicTime() - start) / kReferenceCount; - SB_LOG(INFO) << "Measured duration " - << time_per_initialization_usec / - base::Time::kMicrosecondsPerMillisecond - << "ms per initialization."; + LOG(INFO) << "Measured duration " + << time_per_initialization_usec / + base::Time::kMicrosecondsPerMillisecond + << "ms per initialization."; // Graphics system and context initializations should not take more than the // maximum of 250ms or three times as long as the time we just measured. @@ -121,9 +122,9 @@ TEST(GraphicsSystemTest, FLAKY_GraphicsContextCanBeInitializedOften) { int64_t now = starboard::CurrentMonotonicTime(); int64_t elapsed_time_usec = now - last; - SB_LOG(INFO) << "Test duration " - << elapsed_time_usec / base::Time::kMicrosecondsPerMillisecond - << "ms."; + LOG(INFO) << "Test duration " + << elapsed_time_usec / base::Time::kMicrosecondsPerMillisecond + << "ms."; ASSERT_LT(elapsed_time_usec, maximum_time_usec_per_initialization); last = now; } diff --git a/cobalt/renderer/get_default_rasterizer_for_platform.cc b/cobalt/renderer/get_default_rasterizer_for_platform.cc index 863a1da06119..2b5573c66efc 100644 --- a/cobalt/renderer/get_default_rasterizer_for_platform.cc +++ b/cobalt/renderer/get_default_rasterizer_for_platform.cc @@ -16,6 +16,7 @@ #include +#include "base/logging.h" #include "cobalt/configuration/configuration.h" #include "cobalt/renderer/backend/graphics_context.h" #include "cobalt/renderer/rasterizer/egl/hardware_rasterizer.h" @@ -87,7 +88,7 @@ RasterizerInfo GetDefaultRasterizerForPlatform() { return {"skia", base::Bind(&CreateSkiaHardwareRasterizer)}; } } else { - SB_LOG(ERROR) << "GLES2 must be available."; + LOG(ERROR) << "GLES2 must be available."; SB_DCHECK(false); return {}; } diff --git a/cobalt/renderer/rasterizer/pixel_test.cc b/cobalt/renderer/rasterizer/pixel_test.cc index bce79298d369..6015de828fe3 100644 --- a/cobalt/renderer/rasterizer/pixel_test.cc +++ b/cobalt/renderer/rasterizer/pixel_test.cc @@ -19,6 +19,7 @@ #include "base/files/file_path.h" #include "base/i18n/char_iterator.h" #include "base/i18n/icu_string_conversions.h" +#include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/path_service.h" #include "cobalt/base/unicode/character.h" @@ -4040,7 +4041,7 @@ scoped_refptr CreateMapToMeshTestRenderTree( TEST_F(PixelTest, MapToMeshRGBTest) { if (!IsMapToMeshEnabled()) { - SB_LOG(INFO) << "Map to mesh not supported. Test skipped."; + LOG(INFO) << "Map to mesh not supported. Test skipped."; return; } diff --git a/cobalt/renderer/rasterizer/skia/skia/src/ports/SkFontMgr_cobalt.cc b/cobalt/renderer/rasterizer/skia/skia/src/ports/SkFontMgr_cobalt.cc index cb5bf0a641a4..d5cec3ec14cd 100644 --- a/cobalt/renderer/rasterizer/skia/skia/src/ports/SkFontMgr_cobalt.cc +++ b/cobalt/renderer/rasterizer/skia/skia/src/ports/SkFontMgr_cobalt.cc @@ -24,6 +24,7 @@ #include "SkTSearch.h" #include "base/base_switches.h" #include "base/command_line.h" +#include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/trace_event/trace_event.h" #include "cobalt/base/language.h" @@ -397,8 +398,8 @@ void SkFontMgr_Cobalt::BuildNameToFamilyMap( std::make_pair(family_info.names[j].c_str(), new_family.get())); } else { is_duplicate_font = true; - SB_LOG(WARNING) << "Duplicate Font name: \"" - << family_info.names[j].c_str() << "\""; + LOG(WARNING) << "Duplicate Font name: \"" + << family_info.names[j].c_str() << "\""; } } } @@ -438,8 +439,8 @@ void SkFontMgr_Cobalt::BuildNameToFamilyMap( is_duplicate_font_face = true; const std::string font_face_name_type = i == 0 ? "Full Font" : "Postscript"; - SB_LOG(WARNING) << "Duplicate " << font_face_name_type << " name: \"" - << font_face_name << "\""; + LOG(WARNING) << "Duplicate " << font_face_name_type << " name: \"" + << font_face_name << "\""; } } } diff --git a/cobalt/speech/speech_synthesis.cc b/cobalt/speech/speech_synthesis.cc index 27daed8c45c9..b3cd079ab09b 100644 --- a/cobalt/speech/speech_synthesis.cc +++ b/cobalt/speech/speech_synthesis.cc @@ -16,6 +16,7 @@ #include +#include "base/logging.h" #include "cobalt/dom/navigator.h" #include "starboard/speech_synthesis.h" @@ -120,8 +121,8 @@ void SpeechSynthesis::Speak( return; } - SB_DLOG(INFO) << "Speaking: \"" << utterance->text() << "\" " - << utterance->lang(); + DLOG(INFO) << "Speaking: \"" << utterance->text() << "\" " + << utterance->lang(); SbSpeechSynthesisSpeak(utterance->text().c_str()); utterance->DispatchStartEvent(); utterance->DispatchEndEvent(); diff --git a/cobalt/system_window/system_window.cc b/cobalt/system_window/system_window.cc index 76f77f6b025b..37e5961c25f4 100644 --- a/cobalt/system_window/system_window.cc +++ b/cobalt/system_window/system_window.cc @@ -265,7 +265,7 @@ void HandleInputEvent(const SbEvent* event) { if (g_the_window != nullptr) { g_the_window->HandleInputEvent(event); } else { - SB_LOG(ERROR) << "Missing SystemWindow"; + LOG(ERROR) << "Missing SystemWindow"; } return; } diff --git a/cobalt/watchdog/instrumentation_log.cc b/cobalt/watchdog/instrumentation_log.cc index af7f248b54b5..ec85b730c9be 100644 --- a/cobalt/watchdog/instrumentation_log.cc +++ b/cobalt/watchdog/instrumentation_log.cc @@ -17,12 +17,14 @@ #include #include +#include "base/logging.h" + namespace cobalt { namespace watchdog { bool InstrumentationLog::LogEvent(const std::string& event) { if (event.length() > kMaxEventLenBytes) { - SB_DLOG(ERROR) << "[Watchdog] Log event exceeds max: " << kMaxEventLenBytes; + DLOG(ERROR) << "[Watchdog] Log event exceeds max: " << kMaxEventLenBytes; return false; } diff --git a/cobalt/watchdog/watchdog.cc b/cobalt/watchdog/watchdog.cc index 3846bbb0c47b..785781be7894 100644 --- a/cobalt/watchdog/watchdog.cc +++ b/cobalt/watchdog/watchdog.cc @@ -24,8 +24,8 @@ #include "base/command_line.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" +#include "base/logging.h" #include "starboard/common/file.h" -#include "starboard/common/log.h" #include "starboard/common/time.h" #include "starboard/configuration_constants.h" @@ -143,7 +143,7 @@ std::shared_ptr Watchdog::GetViolationsMap() { } if (violations_map_ == nullptr) { - SB_LOG(INFO) << "[Watchdog] No previous violations JSON."; + LOG(INFO) << "[Watchdog] No previous violations JSON."; violations_map_ = std::make_unique(base::Value::Type::DICT); } } @@ -159,7 +159,7 @@ std::string Watchdog::GetWatchdogFilePath() { kSbFileMaxPath); watchdog_file_path_ = std::string(cache_dir.data()) + kSbFileSepString + watchdog_file_name_; - SB_LOG(INFO) << "[Watchdog] Violations filepath: " << watchdog_file_path_; + LOG(INFO) << "[Watchdog] Violations filepath: " << watchdog_file_path_; } return watchdog_file_path_; } @@ -189,7 +189,7 @@ void Watchdog::WriteWatchdogViolations() { // Writes Watchdog violations to persistent storage as a json file. std::string watchdog_json; base::JSONWriter::Write(*GetViolationsMap(), &watchdog_json); - SB_LOG(INFO) << "[Watchdog] Writing violations to JSON:\n" << watchdog_json; + LOG(INFO) << "[Watchdog] Writing violations to JSON:\n" << watchdog_json; starboard::ScopedFile watchdog_file(GetWatchdogFilePath().c_str(), kSbFileCreateAlways | kSbFileWrite); watchdog_file.WriteAll(watchdog_json.c_str(), @@ -453,7 +453,7 @@ void Watchdog::MaybeTriggerCrash(void* context) { if (static_cast(context)->GetPersistentSettingWatchdogCrash()) { if (static_cast(context)->pending_write_) static_cast(context)->WriteWatchdogViolations(); - SB_LOG(ERROR) << "[Watchdog] Triggering violation Crash!"; + LOG(ERROR) << "[Watchdog] Triggering violation Crash!"; *(reinterpret_cast(0)) = 0; } } @@ -495,9 +495,9 @@ bool Watchdog::Register(std::string name, std::string description, auto result = client_map_.emplace(name, std::move(client)); if (result.second) { - SB_DLOG(INFO) << "[Watchdog] Registered: " << name; + DLOG(INFO) << "[Watchdog] Registered: " << name; } else { - SB_DLOG(ERROR) << "[Watchdog] Unable to Register: " << name; + DLOG(ERROR) << "[Watchdog] Unable to Register: " << name; } return result.second; } @@ -522,7 +522,7 @@ std::shared_ptr Watchdog::RegisterByClient( // Registers. client_list_.emplace_back(client); - SB_DLOG(INFO) << "[Watchdog] Registered: " << name; + DLOG(INFO) << "[Watchdog] Registered: " << name; return client; } @@ -534,12 +534,12 @@ std::unique_ptr Watchdog::CreateClient( // Validates parameters. if (time_interval_microseconds < watchdog_monitor_frequency_ || time_wait_microseconds < 0) { - SB_DLOG(ERROR) << "[Watchdog] Unable to Register: " << name; + DLOG(ERROR) << "[Watchdog] Unable to Register: " << name; if (time_interval_microseconds < watchdog_monitor_frequency_) { - SB_DLOG(ERROR) << "[Watchdog] Time interval less than min: " - << watchdog_monitor_frequency_; + DLOG(ERROR) << "[Watchdog] Time interval less than min: " + << watchdog_monitor_frequency_; } else { - SB_DLOG(ERROR) << "[Watchdog] Time wait is negative."; + DLOG(ERROR) << "[Watchdog] Time wait is negative."; } return nullptr; } @@ -569,9 +569,9 @@ bool Watchdog::Unregister(const std::string& name, bool lock) { if (lock) mutex_.Release(); if (result) { - SB_DLOG(INFO) << "[Watchdog] Unregistered: " << name; + DLOG(INFO) << "[Watchdog] Unregistered: " << name; } else { - SB_DLOG(ERROR) << "[Watchdog] Unable to Unregister: " << name; + DLOG(ERROR) << "[Watchdog] Unable to Unregister: " << name; } return result; } @@ -588,11 +588,11 @@ bool Watchdog::UnregisterByClient(std::shared_ptr client) { for (auto it = client_list_.begin(); it != client_list_.end(); it++) { if (client == *it) { client_list_.erase(it); - SB_DLOG(INFO) << "[Watchdog] Unregistered: " << name; + DLOG(INFO) << "[Watchdog] Unregistered: " << name; return true; } } - SB_DLOG(ERROR) << "[Watchdog] Unable to Unregister: " << name; + DLOG(ERROR) << "[Watchdog] Unable to Unregister: " << name; return false; } @@ -610,7 +610,7 @@ bool Watchdog::Ping(const std::string& name, const std::string& info) { Client* client = it->second.get(); return PingHelper(client, name, info); } - SB_DLOG(ERROR) << "[Watchdog] Unable to Ping: " << name; + DLOG(ERROR) << "[Watchdog] Unable to Ping: " << name; return false; } @@ -632,7 +632,7 @@ bool Watchdog::PingByClient(std::shared_ptr client, return PingHelper(client.get(), name, info); } } - SB_DLOG(ERROR) << "[Watchdog] Unable to Ping: " << name; + DLOG(ERROR) << "[Watchdog] Unable to Ping: " << name; return false; } @@ -640,9 +640,9 @@ bool Watchdog::PingHelper(Client* client, const std::string& name, const std::string& info) { // Validates parameters. if (info.length() > kWatchdogMaxPingInfoLength) { - SB_DLOG(ERROR) << "[Watchdog] Unable to Ping: " << name; - SB_DLOG(ERROR) << "[Watchdog] Ping info length exceeds max: " - << kWatchdogMaxPingInfoLength; + DLOG(ERROR) << "[Watchdog] Unable to Ping: " << name; + DLOG(ERROR) << "[Watchdog] Ping info length exceeds max: " + << kWatchdogMaxPingInfoLength; return false; } @@ -705,10 +705,9 @@ std::string Watchdog::GetWatchdogViolations( EvictOldWatchdogViolations(); } } - SB_LOG(INFO) << "[Watchdog] Reading violations:\n" - << fetched_violations_json; + LOG(INFO) << "[Watchdog] Reading violations:\n" << fetched_violations_json; } else { - SB_LOG(INFO) << "[Watchdog] No violations."; + LOG(INFO) << "[Watchdog] No violations."; } return fetched_violations_json; } diff --git a/cobalt/web/navigator_ua_data.cc b/cobalt/web/navigator_ua_data.cc index 7c4d258ca7ad..25db46917b65 100644 --- a/cobalt/web/navigator_ua_data.cc +++ b/cobalt/web/navigator_ua_data.cc @@ -14,6 +14,7 @@ #include "cobalt/web/navigator_ua_data.h" +#include "base/logging.h" #include "base/strings/stringprintf.h" namespace cobalt { @@ -24,7 +25,7 @@ NavigatorUAData::NavigatorUAData( script::ScriptValueFactory* script_value_factory) : script_value_factory_(script_value_factory) { if (platform_info == nullptr) { - SB_DLOG(WARNING) + DLOG(WARNING) << "No UserAgentPlatformInfo object passed to NavigatorUAData"; return; } diff --git a/cobalt/xhr/url_fetcher_buffer_writer.cc b/cobalt/xhr/url_fetcher_buffer_writer.cc index 38764375a45d..eaa71836d44b 100644 --- a/cobalt/xhr/url_fetcher_buffer_writer.cc +++ b/cobalt/xhr/url_fetcher_buffer_writer.cc @@ -274,8 +274,8 @@ void URLFetcherResponseWriter::Buffer::Write(const void* buffer, if (type_ == kString) { if (capacity_known_ && num_bytes + data_as_string_.size() >= data_as_string_.capacity()) { - SB_LOG(WARNING) << "Data written is larger than the preset capacity " - << data_as_string_.capacity(); + LOG(WARNING) << "Data written is larger than the preset capacity " + << data_as_string_.capacity(); } data_as_string_.append(data, num_bytes); return; @@ -285,8 +285,8 @@ void URLFetcherResponseWriter::Buffer::Write(const void* buffer, if (data_as_array_buffer_size_ + num_bytes > data_as_array_buffer_.byte_length()) { if (capacity_known_) { - SB_LOG(WARNING) << "Data written is larger than the preset capacity " - << data_as_array_buffer_.byte_length(); + LOG(WARNING) << "Data written is larger than the preset capacity " + << data_as_array_buffer_.byte_length(); } size_t new_size = std::max( std::min(data_as_array_buffer_.byte_length() * kResizingMultiplier, diff --git a/components/crx_file/crx_verifier.cc b/components/crx_file/crx_verifier.cc index 4ed1d83766da..7cb72b5b89a3 100644 --- a/components/crx_file/crx_verifier.cc +++ b/components/crx_file/crx_verifier.cc @@ -592,7 +592,7 @@ VerifierResult Verify( ReadAndHashLittleEndianUInt32FromString(&it, file_hash.get()); VerifierResult result; if (version == 2) - SB_LOG(WARNING) << "The string is in CRX2 format, which is deprecated and " + LOG(WARNING) << "The string is in CRX2 format, which is deprecated and " << "will not be supported in M78+"; if (format == VerifierFormat::CRX2_OR_CRX3 && (version == 2 || (diff && version == 0))) {