• 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_function",
94        "//pw_log:log_proto_cc.pwpb",
95        "//pw_log:log_proto_cc.raw_rpc",
96        "//pw_multisink",
97        "//pw_protobuf",
98        "//pw_result",
99        "//pw_status",
100        "//pw_sync:lock_annotations",
101        "//pw_sync:mutex",
102    ],
103)
104
105pw_cc_library(
106    name = "rpc_log_drain_thread",
107    hdrs = ["public/pw_log_rpc/rpc_log_drain_thread.h"],
108    includes = ["public"],
109    deps = [
110        ":log_service",
111        ":rpc_log_drain",
112        "//pw_chrono:system_clock",
113        "//pw_multisink",
114        "//pw_result",
115        "//pw_rpc/raw:server_api",
116        "//pw_status",
117        "//pw_sync:timed_thread_notification",
118        "//pw_thread:thread",
119    ],
120)
121
122pw_cc_library(
123    name = "test_utils",
124    srcs = ["test_utils.cc"],
125    hdrs = ["pw_log_rpc_private/test_utils.h"],
126    deps = [
127        "//pw_bytes",
128        "//pw_containers:vector",
129        "//pw_log",
130        "//pw_log:log_pwpb",
131        "//pw_log_tokenized:metadata",
132        "//pw_protobuf",
133        "//pw_protobuf:bytes_utils",
134        "//pw_unit_test",
135    ],
136)
137
138pw_cc_test(
139    name = "log_service_test",
140    srcs = ["log_service_test.cc"],
141    deps = [
142        ":log_filter",
143        ":log_service",
144        ":test_utils",
145        "//pw_containers:vector",
146        "//pw_log",
147        "//pw_log:log_proto_cc.pwpb",
148        "//pw_log:proto_utils",
149        "//pw_log_tokenized:headers",
150        "//pw_protobuf",
151        "//pw_protobuf:bytes_utils",
152        "//pw_result",
153        "//pw_rpc/raw:test_method_context",
154        "//pw_status",
155        "//pw_unit_test",
156    ],
157)
158
159pw_cc_test(
160    name = "log_filter_service_test",
161    srcs = ["log_filter_service_test.cc"],
162    deps = [
163        ":log_filter",
164        ":log_filter_service",
165        "//pw_log:log_proto_cc.pwpb",
166        "//pw_protobuf",
167        "//pw_protobuf:bytes_utils",
168        "//pw_result",
169        "//pw_rpc/raw:test_method_context",
170        "//pw_unit_test",
171    ],
172)
173
174pw_cc_test(
175    name = "log_filter_test",
176    srcs = ["log_filter_test.cc"],
177    deps = [
178        ":log_filter",
179        "//pw_log:log_proto_cc.pwpb",
180        "//pw_log:proto_utils",
181        "//pw_log_tokenized:headers",
182        "//pw_result",
183        "//pw_status",
184        "//pw_unit_test",
185    ],
186)
187
188pw_cc_test(
189    name = "rpc_log_drain_test",
190    srcs = ["rpc_log_drain_test.cc"],
191    deps = [
192        ":log_service",
193        ":rpc_log_drain",
194        ":test_utils",
195        "//pw_bytes",
196        "//pw_log:log_pwpb",
197        "//pw_multisink",
198        "//pw_protobuf",
199        "//pw_rpc",
200        "//pw_rpc/raw:server_api",
201        "//pw_rpc/raw:test_method_context",
202        "//pw_status",
203        "//pw_sync:mutex",
204        "//pw_unit_test",
205    ],
206)
207