• 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_test",
18)
19
20package(default_visibility = ["//visibility:public"])
21
22licenses(["notice"])
23
24cc_library(
25    name = "config",
26    hdrs = [
27        "public/pw_log_rpc/internal/config.h",
28    ],
29    includes = ["public"],
30    visibility = ["//visibility:private"],
31    deps = [
32        ":config_override",
33    ],
34)
35
36label_flag(
37    name = "config_override",
38    build_setting_default = "//pw_build:default_module_config",
39)
40
41cc_library(
42    name = "log_service",
43    srcs = [
44        "log_service.cc",
45        "public/pw_log_rpc/internal/log_config.h",
46    ],
47    hdrs = ["public/pw_log_rpc/log_service.h"],
48    includes = ["public"],
49    deps = [
50        ":config",
51        ":log_filter",
52        ":rpc_log_drain",
53        "//pw_log",
54        "//pw_log:log_proto_cc.pwpb",
55        "//pw_log:log_proto_cc.raw_rpc",
56    ],
57)
58
59cc_library(
60    name = "log_filter_service",
61    srcs = ["log_filter_service.cc"],
62    hdrs = ["public/pw_log_rpc/log_filter_service.h"],
63    includes = ["public"],
64    deps = [
65        ":log_filter",
66        "//pw_log",
67        "//pw_log:log_proto_cc.pwpb",
68        "//pw_log:log_proto_cc.raw_rpc",
69        "//pw_protobuf",
70        "//pw_protobuf:bytes_utils",
71    ],
72)
73
74cc_library(
75    name = "log_filter",
76    srcs = [
77        "log_filter.cc",
78    ],
79    hdrs = [
80        "public/pw_log_rpc/log_filter.h",
81        "public/pw_log_rpc/log_filter_map.h",
82    ],
83    includes = ["public"],
84    deps = [
85        ":config",
86        "//pw_assert",
87        "//pw_bytes",
88        "//pw_containers:vector",
89        "//pw_log",
90        "//pw_log:log_proto_cc.pwpb",
91        "//pw_protobuf",
92        "//pw_status",
93    ],
94)
95
96cc_library(
97    name = "rpc_log_drain",
98    srcs = [
99        "rpc_log_drain.cc",
100    ],
101    hdrs = [
102        "public/pw_log_rpc/rpc_log_drain.h",
103        "public/pw_log_rpc/rpc_log_drain_map.h",
104    ],
105    includes = ["public"],
106    deps = [
107        ":config",
108        ":log_filter",
109        "//pw_assert",
110        "//pw_chrono:system_clock",
111        "//pw_function",
112        "//pw_log:log_proto_cc.pwpb",
113        "//pw_log:log_proto_cc.raw_rpc",
114        "//pw_multisink",
115        "//pw_protobuf",
116        "//pw_result",
117        "//pw_status",
118        "//pw_sync:lock_annotations",
119        "//pw_sync:mutex",
120    ],
121)
122
123cc_library(
124    name = "rpc_log_drain_thread",
125    hdrs = ["public/pw_log_rpc/rpc_log_drain_thread.h"],
126    includes = ["public"],
127    deps = [
128        ":log_service",
129        ":rpc_log_drain",
130        "//pw_chrono:system_clock",
131        "//pw_multisink",
132        "//pw_result",
133        "//pw_rpc/raw:server_api",
134        "//pw_status",
135        "//pw_sync:timed_thread_notification",
136        "//pw_thread:thread",
137    ],
138)
139
140cc_library(
141    name = "test_utils",
142    testonly = True,
143    srcs = ["test_utils.cc"],
144    hdrs = ["pw_log_rpc_private/test_utils.h"],
145    deps = [
146        "//pw_bytes",
147        "//pw_containers:vector",
148        "//pw_log",
149        "//pw_log:log_proto_cc.pwpb",
150        "//pw_log_tokenized:headers",
151        "//pw_protobuf",
152        "//pw_protobuf:bytes_utils",
153        "//pw_unit_test",
154    ],
155)
156
157pw_cc_test(
158    name = "log_service_test",
159    srcs = ["log_service_test.cc"],
160    deps = [
161        ":log_filter",
162        ":log_service",
163        ":test_utils",
164        "//pw_containers:vector",
165        "//pw_log",
166        "//pw_log:log_proto_cc.pwpb",
167        "//pw_log:proto_utils",
168        "//pw_log_tokenized:headers",
169        "//pw_protobuf",
170        "//pw_protobuf:bytes_utils",
171        "//pw_result",
172        "//pw_rpc/raw:test_method_context",
173        "//pw_status",
174        "//pw_unit_test",
175    ],
176)
177
178pw_cc_test(
179    name = "log_filter_service_test",
180    srcs = ["log_filter_service_test.cc"],
181    deps = [
182        ":log_filter",
183        ":log_filter_service",
184        "//pw_log:log_proto_cc.pwpb",
185        "//pw_protobuf",
186        "//pw_protobuf:bytes_utils",
187        "//pw_result",
188        "//pw_rpc/raw:test_method_context",
189        "//pw_unit_test",
190    ],
191)
192
193pw_cc_test(
194    name = "log_filter_test",
195    srcs = ["log_filter_test.cc"],
196    deps = [
197        ":log_filter",
198        "//pw_log:log_proto_cc.pwpb",
199        "//pw_log:proto_utils",
200        "//pw_log_tokenized:headers",
201        "//pw_result",
202        "//pw_status",
203        "//pw_unit_test",
204    ],
205)
206
207pw_cc_test(
208    name = "rpc_log_drain_test",
209    srcs = ["rpc_log_drain_test.cc"],
210    deps = [
211        ":log_service",
212        ":rpc_log_drain",
213        ":test_utils",
214        "//pw_bytes",
215        "//pw_log:log_proto_cc.pwpb",
216        "//pw_log:proto_utils",
217        "//pw_multisink",
218        "//pw_protobuf",
219        "//pw_rpc",
220        "//pw_rpc/raw:server_api",
221        "//pw_rpc/raw:test_method_context",
222        "//pw_status",
223        "//pw_sync:mutex",
224        "//pw_unit_test",
225    ],
226)
227