Automated rollback of commit 27af0228e240cbe38a7df100f64c26a76a5be14f
PiperOrigin-RevId: 272114241
diff --git a/tensorflow/core/platform/BUILD b/tensorflow/core/platform/BUILD
index ed0a107..2f73f32 100644
--- a/tensorflow/core/platform/BUILD
+++ b/tensorflow/core/platform/BUILD
@@ -20,6 +20,7 @@
"tf_additional_rocdl_srcs",
"tf_additional_tensor_coding_deps",
"tf_additional_test_srcs",
+ "tf_logging_absl_deps",
"tf_platform_hdrs",
"tf_platform_srcs",
"tf_protobuf_compiler_deps",
@@ -28,8 +29,8 @@
load(
"//tensorflow/core/platform:default/build_refactor.bzl",
"tf_instantiate_platform_libraries",
- "tf_mobile_aware_deps",
"tf_platform_helper_deps",
+ "tf_mobile_aware_deps",
)
load(
"//tensorflow:tensorflow.bzl",
@@ -61,7 +62,6 @@
"env",
"env_time",
"human_readable_json",
- "logging",
"load_library",
"mutex",
"net",
@@ -272,8 +272,15 @@
cc_library(
name = "logging",
- textual_hdrs = ["logging.h"],
- deps = [":logging_impl"],
+ srcs = tf_platform_hdrs(["logging.h"]) + tf_platform_srcs(["logging.cc"]),
+ hdrs = ["logging.h"],
+ deps = [
+ ":env_time",
+ ":macros",
+ ":platform",
+ ":types",
+ "//tensorflow/core/platform/default/build_config:base",
+ ] + tf_logging_absl_deps(),
)
cc_library(
diff --git a/tensorflow/core/platform/default/build_config.bzl b/tensorflow/core/platform/default/build_config.bzl
index 482165b..dd7464c 100644
--- a/tensorflow/core/platform/default/build_config.bzl
+++ b/tensorflow/core/platform/default/build_config.bzl
@@ -747,6 +747,12 @@
def tf_additional_tensor_coding_deps():
return []
+def tf_logging_absl_deps():
+ return [
+ "@com_google_absl//absl/base",
+ "@com_google_absl//absl/strings",
+ ]
+
def tf_protobuf_deps():
return [
"@com_google_protobuf//:protobuf",
diff --git a/tensorflow/core/platform/default/build_refactor.bzl b/tensorflow/core/platform/default/build_refactor.bzl
index 0a5c346..f8da8fd 100644
--- a/tensorflow/core/platform/default/build_refactor.bzl
+++ b/tensorflow/core/platform/default/build_refactor.bzl
@@ -154,28 +154,6 @@
"visibility": ["//visibility:private"],
"tags": ["no_oss", "manual"],
},
- "logging": {
- "name": "logging_impl",
- "hdrs": [
- "//tensorflow/core/platform:logging.h",
- ],
- "textual_hdrs": [
- "//tensorflow/core/platform:default/logging.h",
- ],
- "srcs": [
- "//tensorflow/core/platform:default/logging.cc",
- ],
- "deps": [
- "@com_google_absl//absl/base",
- "@com_google_absl//absl/strings",
- "//tensorflow/core/platform",
- "//tensorflow/core/platform:env_time",
- "//tensorflow/core/platform:macros",
- "//tensorflow/core/platform:types",
- ],
- "visibility": ["//visibility:private"],
- "tags": ["no_oss", "manual"],
- },
"mutex": {
"name": "mutex_impl",
"hdrs": [
diff --git a/tensorflow/core/platform/logging.h b/tensorflow/core/platform/logging.h
index 398e178..45cb59e 100644
--- a/tensorflow/core/platform/logging.h
+++ b/tensorflow/core/platform/logging.h
@@ -17,11 +17,20 @@
#define TENSORFLOW_CORE_PLATFORM_LOGGING_H_
#include "tensorflow/core/platform/platform.h" // To pick up PLATFORM_define
-#include "tensorflow/core/platform/types.h"
#if defined(PLATFORM_GOOGLE) || defined(PLATFORM_GOOGLE_ANDROID) || \
defined(GOOGLE_LOGGING) || defined(__EMSCRIPTEN__)
#include "tensorflow/core/platform/google/build_config/logging.h"
+namespace tensorflow {
+// Adapt Google LogSink interface to the TF interface.
+using TFLogSink = ::absl::LogSink;
+using TFLogEntry = ::absl::LogEntry;
+
+inline void TFAddLogSink(TFLogSink* sink) { ::absl::AddLogSink(sink); }
+inline void TFRemoveLogSink(TFLogSink* sink) { ::absl::RemoveLogSink(sink); }
+
+} // namespace tensorflow
+
#else
#include "tensorflow/core/platform/default/logging.h"
#endif