From 80b762a281879cbbb84d5c1da42a9638633bb4bf Mon Sep 17 00:00:00 2001 From: MediaPipe Team Date: Thu, 7 Sep 2023 14:16:36 -0700 Subject: [PATCH] No public description PiperOrigin-RevId: 563543098 --- mediapipe/gpu/BUILD | 2 +- mediapipe/gpu/gl_texture_buffer.cc | 2 +- mediapipe/gpu/shader_util.cc | 4 ++-- mediapipe/tasks/c/text/text_classifier/BUILD | 1 + mediapipe/tasks/c/text/text_classifier/text_classifier.cc | 8 +++++--- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/mediapipe/gpu/BUILD b/mediapipe/gpu/BUILD index bdedb85f2..b7c1a27d8 100644 --- a/mediapipe/gpu/BUILD +++ b/mediapipe/gpu/BUILD @@ -767,8 +767,8 @@ cc_library( deps = [ ":gl_base", "//mediapipe/framework/port:logging", + "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/log:absl_log", - "@com_google_absl//absl/log:check", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", ], diff --git a/mediapipe/gpu/gl_texture_buffer.cc b/mediapipe/gpu/gl_texture_buffer.cc index 0ea511c5b..48afbd219 100644 --- a/mediapipe/gpu/gl_texture_buffer.cc +++ b/mediapipe/gpu/gl_texture_buffer.cc @@ -173,7 +173,7 @@ bool GlTextureBuffer::CreateInternal(const void* data, int alignment) { // normal single-context behavior. E.g. if you do bind, delete, render, // unbind, the object is not deleted until the unbind, and it waits for // the render to finish. - DLOG_IF(ERROR, !glIsTexture(name_to_delete)) + ABSL_DLOG_IF(ERROR, !glIsTexture(name_to_delete)) << "Deleting invalid texture id: " << name_to_delete; glDeleteTextures(1, &name_to_delete); }); diff --git a/mediapipe/gpu/shader_util.cc b/mediapipe/gpu/shader_util.cc index 83dc33df2..f50b5e6c9 100644 --- a/mediapipe/gpu/shader_util.cc +++ b/mediapipe/gpu/shader_util.cc @@ -20,8 +20,8 @@ #include #include +#include "absl/log/absl_check.h" #include "absl/log/absl_log.h" -#include "absl/log/check.h" #include "absl/strings/str_format.h" #include "absl/strings/str_join.h" #include "absl/strings/str_split.h" @@ -67,7 +67,7 @@ std::string AddLineNumbers(const GLchar* source) { std::string format = absl::StrFormat( "%%%ii %%s", static_cast(ceilf(log10(1 + lines.size())))); auto parsed_format = absl::ParsedFormat<'i', 's'>::New(format); - CHECK(parsed_format); + ABSL_CHECK(parsed_format); for (int n = 0; n < lines.size(); n++) { lines[n] = absl::StrFormat(*parsed_format, n + 1, lines[n]); } diff --git a/mediapipe/tasks/c/text/text_classifier/BUILD b/mediapipe/tasks/c/text/text_classifier/BUILD index 93ea468db..3fdd06cc0 100644 --- a/mediapipe/tasks/c/text/text_classifier/BUILD +++ b/mediapipe/tasks/c/text/text_classifier/BUILD @@ -26,5 +26,6 @@ cc_library( "//mediapipe/tasks/c/components/processors:classifier_options", "//mediapipe/tasks/c/core:base_options", "//mediapipe/tasks/cc/text/text_classifier", + "@com_google_absl//absl/log:absl_log", ], ) diff --git a/mediapipe/tasks/c/text/text_classifier/text_classifier.cc b/mediapipe/tasks/c/text/text_classifier/text_classifier.cc index b88a66bc4..9faca2a1b 100644 --- a/mediapipe/tasks/c/text/text_classifier/text_classifier.cc +++ b/mediapipe/tasks/c/text/text_classifier/text_classifier.cc @@ -17,6 +17,7 @@ limitations under the License. #include +#include "absl/log/absl_log.h" #include "mediapipe/tasks/c/components/containers/classification_result.h" #include "mediapipe/tasks/c/components/processors/classifier_options.h" #include "mediapipe/tasks/c/core/base_options.h" @@ -44,7 +45,8 @@ TextClassifier* CppTextClassifierCreate(TextClassifierOptions options) { auto classifier = TextClassifier::Create(std::move(cpp_options)); if (!classifier.ok()) { - LOG(ERROR) << "Failed to create TextClassifier: " << classifier.status(); + ABSL_LOG(ERROR) << "Failed to create TextClassifier: " + << classifier.status(); return nullptr; } return classifier->release(); @@ -55,7 +57,7 @@ bool CppTextClassifierClassify(void* classifier, char* utf8_str, auto cpp_classifier = static_cast(classifier); auto cpp_result = cpp_classifier->Classify(utf8_str); if (!cpp_result.ok()) { - LOG(ERROR) << "Classification failed: " << cpp_result.status(); + ABSL_LOG(ERROR) << "Classification failed: " << cpp_result.status(); return false; } CppConvertToClassificationResult(*cpp_result, result); @@ -66,7 +68,7 @@ void CppTextClassifierClose(void* classifier) { auto cpp_classifier = static_cast(classifier); auto result = cpp_classifier->Close(); if (!result.ok()) { - LOG(ERROR) << "Failed to close TextClassifier: " << result; + ABSL_LOG(ERROR) << "Failed to close TextClassifier: " << result; } delete cpp_classifier; }