pw_log_multisink: Move log queue and proto
Moves LogQueue to pw_multisink and log.proto to pw_log.
Change-Id: Icf81e9f6178e2a07a5927053d9d7f29e3153429b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22461
Pigweed-Auto-Submit: Prashanth Swaminathan <prashanthsw@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index 4aae84e..6b5b248 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -262,6 +262,7 @@
"$dir_pw_hdlc_lite:tests",
"$dir_pw_hex_dump:tests",
"$dir_pw_log:tests",
+ "$dir_pw_log_multisink:tests",
"$dir_pw_log_null:tests",
"$dir_pw_log_rpc:tests",
"$dir_pw_log_tokenized:tests",
diff --git a/docs/BUILD.gn b/docs/BUILD.gn
index 50abacc..034587b 100644
--- a/docs/BUILD.gn
+++ b/docs/BUILD.gn
@@ -73,6 +73,7 @@
"$dir_pw_kvs:docs",
"$dir_pw_log:docs",
"$dir_pw_log_basic:docs",
+ "$dir_pw_log_multisink:docs",
"$dir_pw_log_null:docs",
"$dir_pw_log_rpc:docs",
"$dir_pw_log_tokenized:docs",
diff --git a/modules.gni b/modules.gni
index 974c2a4..e71cfb2 100644
--- a/modules.gni
+++ b/modules.gni
@@ -42,6 +42,7 @@
dir_pw_kvs = get_path_info("pw_kvs", "abspath")
dir_pw_log = get_path_info("pw_log", "abspath")
dir_pw_log_basic = get_path_info("pw_log_basic", "abspath")
+ dir_pw_log_multisink = get_path_info("pw_log_multisink", "abspath")
dir_pw_log_null = get_path_info("pw_log_null", "abspath")
dir_pw_log_rpc = get_path_info("pw_log_rpc", "abspath")
dir_pw_log_tokenized = get_path_info("pw_log_tokenized", "abspath")
diff --git a/pw_log/BUILD.gn b/pw_log/BUILD.gn
index 8aa9b43..ce33c97 100644
--- a/pw_log/BUILD.gn
+++ b/pw_log/BUILD.gn
@@ -16,6 +16,7 @@
import("$dir_pw_build/facade.gni")
import("$dir_pw_docgen/docs.gni")
+import("$dir_pw_protobuf_compiler/proto.gni")
import("$dir_pw_unit_test/test.gni")
declare_args() {
@@ -55,6 +56,10 @@
]
}
+pw_proto_library("protos") {
+ sources = [ "pw_log_proto/log.proto" ]
+}
+
pw_doc_group("docs") {
sources = [ "docs.rst" ]
}
diff --git a/pw_log_rpc/pw_log_proto/log.proto b/pw_log/pw_log_proto/log.proto
similarity index 100%
rename from pw_log_rpc/pw_log_proto/log.proto
rename to pw_log/pw_log_proto/log.proto
diff --git a/pw_log_multisink/BUILD b/pw_log_multisink/BUILD
new file mode 100644
index 0000000..5b96a5c
--- /dev/null
+++ b/pw_log_multisink/BUILD
@@ -0,0 +1,48 @@
+# Copyright 2020 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+load(
+ "//pw_build:pigweed.bzl",
+ "pw_cc_library",
+ "pw_cc_test",
+)
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"]) # Apache License 2.0
+
+pw_cc_library(
+ name = "pw_log_queue",
+ srcs = [ "log_queue.cc" ],
+ includes = [ "public" ],
+ deps = [
+ "//pw_bytes",
+ "//pw_log",
+ "//pw_result",
+ "//pw_ring_buffer",
+ "//pw_status",
+ ],
+ hdrs = [ "public/pw_log_multisink/log_queue.h" ]
+)
+
+pw_cc_test(
+ name = "log_queue_test",
+ srcs = [
+ "log_queue_test.cc",
+ ],
+ deps = [
+ "//pw_preprocessor",
+ "//pw_unit_test",
+ ],
+)
diff --git a/pw_log_multisink/BUILD.gn b/pw_log_multisink/BUILD.gn
new file mode 100644
index 0000000..b519519
--- /dev/null
+++ b/pw_log_multisink/BUILD.gn
@@ -0,0 +1,55 @@
+# Copyright 2020 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+import("//build_overrides/pigweed.gni")
+
+import("$dir_pw_build/target_types.gni")
+import("$dir_pw_docgen/docs.gni")
+import("$dir_pw_unit_test/test.gni")
+
+config("default_config") {
+ include_dirs = [ "public" ]
+ visibility = [ ":*" ]
+}
+
+pw_source_set("log_queue") {
+ public_configs = [ ":default_config" ]
+ public = [ "public/pw_log_multisink/log_queue.h" ]
+ public_deps = [
+ "$dir_pw_bytes",
+ "$dir_pw_log",
+ "$dir_pw_result",
+ "$dir_pw_ring_buffer",
+ "$dir_pw_status",
+ ]
+ sources = [ "log_queue.cc" ]
+ deps = [ "$dir_pw_log:protos.pwpb" ]
+}
+
+pw_doc_group("docs") {
+ sources = [ "docs.rst" ]
+}
+
+pw_test("log_queue_test") {
+ sources = [ "log_queue_test.cc" ]
+ deps = [
+ ":log_queue",
+ "$dir_pw_log:protos.pwpb",
+ "$dir_pw_protobuf",
+ ]
+}
+
+pw_test_group("tests") {
+ tests = [ ":log_queue_test" ]
+}
diff --git a/pw_log_multisink/docs.rst b/pw_log_multisink/docs.rst
new file mode 100644
index 0000000..1c16a0c
--- /dev/null
+++ b/pw_log_multisink/docs.rst
@@ -0,0 +1,8 @@
+.. _module-pw_log_multisink:
+
+----------------
+pw_log_multisink
+----------------
+This is a RPC-based logging backend for Pigweed. It is not ready for use, and
+is under construction.
+
diff --git a/pw_log_rpc/log_queue.cc b/pw_log_multisink/log_queue.cc
similarity index 98%
rename from pw_log_rpc/log_queue.cc
rename to pw_log_multisink/log_queue.cc
index a17cedf..65411eb 100644
--- a/pw_log_rpc/log_queue.cc
+++ b/pw_log_multisink/log_queue.cc
@@ -12,7 +12,7 @@
// License for the specific language governing permissions and limitations under
// the License.
-#include "pw_log_rpc/log_queue.h"
+#include "pw_log_multisink/log_queue.h"
#include "pw_log/levels.h"
#include "pw_log_proto/log.pwpb.h"
diff --git a/pw_log_rpc/log_queue_test.cc b/pw_log_multisink/log_queue_test.cc
similarity index 99%
rename from pw_log_rpc/log_queue_test.cc
rename to pw_log_multisink/log_queue_test.cc
index f6a499a..7fe3fd6 100644
--- a/pw_log_rpc/log_queue_test.cc
+++ b/pw_log_multisink/log_queue_test.cc
@@ -12,7 +12,7 @@
// License for the specific language governing permissions and limitations under
// the License.
-#include "pw_log_rpc/log_queue.h"
+#include "pw_log_multisink/log_queue.h"
#include "gtest/gtest.h"
#include "pw_log/levels.h"
diff --git a/pw_log_rpc/public/pw_log_rpc/log_queue.h b/pw_log_multisink/public/pw_log_multisink/log_queue.h
similarity index 100%
rename from pw_log_rpc/public/pw_log_rpc/log_queue.h
rename to pw_log_multisink/public/pw_log_multisink/log_queue.h
diff --git a/pw_log_rpc/BUILD b/pw_log_rpc/BUILD
index 17c9649..a779851 100644
--- a/pw_log_rpc/BUILD
+++ b/pw_log_rpc/BUILD
@@ -35,31 +35,6 @@
hdrs = [ "public/pw_log_rpc/logs_rpc.h" ]
)
-pw_cc_library(
- name = "pw_log_queue",
- srcs = [ "log_queue.cc" ],
- includes = [ "public" ],
- deps = [
- "//pw_bytes",
- "//pw_log",
- "//pw_result",
- "//pw_ring_buffer",
- "//pw_status",
- ],
- hdrs = [ "public/pw_log_rpc/log_queue.h" ]
-)
-
-pw_cc_test(
- name = "log_queue_test",
- srcs = [
- "log_queue_test.cc",
- ],
- deps = [
- "//pw_preprocessor",
- "//pw_unit_test",
- ],
-)
-
pw_cc_test(
name = "logs_rpc_test",
srcs = [
diff --git a/pw_log_rpc/BUILD.gn b/pw_log_rpc/BUILD.gn
index 2f308a0..ea40507 100644
--- a/pw_log_rpc/BUILD.gn
+++ b/pw_log_rpc/BUILD.gn
@@ -16,7 +16,6 @@
import("$dir_pw_build/target_types.gni")
import("$dir_pw_docgen/docs.gni")
-import("$dir_pw_protobuf_compiler/proto.gni")
import("$dir_pw_unit_test/test.gni")
config("default_config") {
@@ -29,26 +28,12 @@
public = [ "public/pw_log_rpc/logs_rpc.h" ]
sources = [ "logs_rpc.cc" ]
public_deps = [
- ":log_queue",
- ":protos.pwpb",
- ":protos.raw_rpc",
+ "$dir_pw_log:protos.pwpb",
+ "$dir_pw_log:protos.raw_rpc",
+ "$dir_pw_log_multisink:log_queue",
]
}
-pw_source_set("log_queue") {
- public_configs = [ ":default_config" ]
- public = [ "public/pw_log_rpc/log_queue.h" ]
- public_deps = [
- "$dir_pw_bytes",
- "$dir_pw_log",
- "$dir_pw_result",
- "$dir_pw_ring_buffer",
- "$dir_pw_status",
- ]
- sources = [ "log_queue.cc" ]
- deps = [ ":protos.pwpb" ]
-}
-
pw_test("logs_rpc_test") {
deps = [
":logs",
@@ -57,26 +42,10 @@
sources = [ "logs_rpc_test.cc" ]
}
-pw_proto_library("protos") {
- sources = [ "pw_log_proto/log.proto" ]
-}
-
pw_doc_group("docs") {
sources = [ "docs.rst" ]
}
-pw_test("log_queue_test") {
- sources = [ "log_queue_test.cc" ]
- deps = [
- ":log_queue",
- ":protos.pwpb",
- dir_pw_protobuf,
- ]
-}
-
pw_test_group("tests") {
- tests = [
- ":log_queue_test",
- ":logs_rpc_test",
- ]
+ tests = [ ":logs_rpc_test" ]
}
diff --git a/pw_log_rpc/public/pw_log_rpc/logs_rpc.h b/pw_log_rpc/public/pw_log_rpc/logs_rpc.h
index 2bd354f..0e3d0fd 100644
--- a/pw_log_rpc/public/pw_log_rpc/logs_rpc.h
+++ b/pw_log_rpc/public/pw_log_rpc/logs_rpc.h
@@ -15,8 +15,8 @@
#pragma once
#include "pw_log/log.h"
+#include "pw_log_multisink/log_queue.h"
#include "pw_log_proto/log.raw_rpc.pb.h"
-#include "pw_log_rpc/log_queue.h"
namespace pw::log_rpc {