• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15load(
16    "//pw_build:pigweed.bzl",
17    "pw_cc_library",
18    "pw_cc_test",
19)
20
21package(default_visibility = ["//visibility:public"])
22
23licenses(["notice"])
24
25pw_cc_library(
26    name = "log_service",
27    srcs = [
28        "log_service.cc",
29        "public/pw_log_rpc/internal/log_config.h",
30    ],
31    hdrs = ["public/pw_log_rpc/log_service.h"],
32    includes = ["public"],
33    deps = [
34        ":log_filter",
35        ":rpc_log_drain",
36        "//pw_log",
37        "//pw_log:log_proto_cc.pwpb",
38        "//pw_log:log_proto_cc.raw_rpc",
39    ],
40)
41
42pw_cc_library(
43    name = "log_filter_service",
44    srcs = ["log_filter_service.cc"],
45    hdrs = ["public/pw_log_rpc/log_filter_service.h"],
46    includes = ["public"],
47    deps = [
48        ":log_filter",
49        "//pw_log",
50        "//pw_log:log_proto_cc.pwpb",
51        "//pw_log:log_proto_cc.raw_rpc",
52        "//pw_protobuf",
53        "//pw_protobuf:bytes_utils",
54    ],
55)
56
57pw_cc_library(
58    name = "log_filter",
59    srcs = [
60        "log_filter.cc",
61        "public/pw_log_rpc/internal/config.h",
62    ],
63    hdrs = [
64        "public/pw_log_rpc/log_filter.h",
65        "public/pw_log_rpc/log_filter_map.h",
66    ],
67    includes = ["public"],
68    deps = [
69        "//pw_assert",
70        "//pw_bytes",
71        "//pw_containers:vector",
72        "//pw_log",
73        "//pw_log:log_proto_cc.pwpb",
74        "//pw_protobuf",
75        "//pw_status",
76    ],
77)
78
79pw_cc_library(
80    name = "rpc_log_drain",
81    srcs = [
82        "public/pw_log_rpc/internal/config.h",
83        "rpc_log_drain.cc",
84    ],
85    hdrs = [
86        "public/pw_log_rpc/rpc_log_drain.h",
87        "public/pw_log_rpc/rpc_log_drain_map.h",
88    ],
89    includes = ["public"],
90    deps = [
91        ":log_filter",
92        "//pw_assert",
93        "//pw_chrono:system_clock",
94        "//pw_function",
95        "//pw_log:log_proto_cc.pwpb",
96        "//pw_log:log_proto_cc.raw_rpc",
97        "//pw_multisink",
98        "//pw_protobuf",
99        "//pw_result",
100        "//pw_status",
101        "//pw_sync:lock_annotations",
102        "//pw_sync:mutex",
103    ],
104)
105
106pw_cc_library(
107    name = "rpc_log_drain_thread",
108    hdrs = ["public/pw_log_rpc/rpc_log_drain_thread.h"],
109    includes = ["public"],
110    deps = [
111        ":log_service",
112        ":rpc_log_drain",
113        "//pw_chrono:system_clock",
114        "//pw_multisink",
115        "//pw_result",
116        "//pw_rpc/raw:server_api",
117        "//pw_status",
118        "//pw_sync:timed_thread_notification",
119        "//pw_thread:thread",
120    ],
121)
122
123pw_cc_library(
124    name = "test_utils",
125    srcs = ["test_utils.cc"],
126    hdrs = ["pw_log_rpc_private/test_utils.h"],
127    deps = [
128        "//pw_bytes",
129        "//pw_containers:vector",
130        "//pw_log",
131        "//pw_log:log_proto_cc.pwpb",
132        "//pw_log_tokenized:headers",
133        "//pw_protobuf",
134        "//pw_protobuf:bytes_utils",
135        "//pw_unit_test",
136    ],
137)
138
139pw_cc_test(
140    name = "log_service_test",
141    srcs = ["log_service_test.cc"],
142    deps = [
143        ":log_filter",
144        ":log_service",
145        ":test_utils",
146        "//pw_containers:vector",
147        "//pw_log",
148        "//pw_log:log_proto_cc.pwpb",
149        "//pw_log:proto_utils",
150        "//pw_log_tokenized:headers",
151        "//pw_protobuf",
152        "//pw_protobuf:bytes_utils",
153        "//pw_result",
154        "//pw_rpc/raw:test_method_context",
155        "//pw_status",
156        "//pw_unit_test",
157    ],
158)
159
160pw_cc_test(
161    name = "log_filter_service_test",
162    srcs = ["log_filter_service_test.cc"],
163    deps = [
164        ":log_filter",
165        ":log_filter_service",
166        "//pw_log:log_proto_cc.pwpb",
167        "//pw_protobuf",
168        "//pw_protobuf:bytes_utils",
169        "//pw_result",
170        "//pw_rpc/raw:test_method_context",
171        "//pw_unit_test",
172    ],
173)
174
175pw_cc_test(
176    name = "log_filter_test",
177    srcs = ["log_filter_test.cc"],
178    deps = [
179        ":log_filter",
180        "//pw_log:log_proto_cc.pwpb",
181        "//pw_log:proto_utils",
182        "//pw_log_tokenized:headers",
183        "//pw_result",
184        "//pw_status",
185        "//pw_unit_test",
186    ],
187)
188
189pw_cc_test(
190    name = "rpc_log_drain_test",
191    srcs = ["rpc_log_drain_test.cc"],
192    deps = [
193        ":log_service",
194        ":rpc_log_drain",
195        ":test_utils",
196        "//pw_bytes",
197        "//pw_log:log_proto_cc.pwpb",
198        "//pw_log:proto_utils",
199        "//pw_multisink",
200        "//pw_protobuf",
201        "//pw_rpc",
202        "//pw_rpc/raw:server_api",
203        "//pw_rpc/raw:test_method_context",
204        "//pw_status",
205        "//pw_sync:mutex",
206        "//pw_unit_test",
207    ],
208)
209