blob: 68a493b8e5c21f1d3425d934676aea5c00853212 [file] [log] [blame]
Tyler Chatow67ddb032020-01-12 14:30:04 -08001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
2
Brian Silvermancb5da1f2015-12-05 22:19:58 -05003# The primary client logging interface.
4cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -08005 name = "logging",
6 srcs = [
7 "context.cc",
8 "interface.cc",
9 ],
10 hdrs = [
11 "context.h",
12 "interface.h",
13 "logging.h",
14 ],
15 visibility = ["//visibility:public"],
16 deps = [
17 ":sizes",
Austin Schuhdf6cbb12019-02-02 13:46:52 -080018 "//aos:complex_thread_local",
John Park33858a32018-09-28 23:05:48 -070019 "//aos:die",
20 "//aos:macros",
21 "//aos/libc:aos_strerror",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080022 ],
Brian Silvermancb5da1f2015-12-05 22:19:58 -050023)
Austin Schuhf0736512015-09-07 01:22:16 -070024
James Kuszmaul011b67a2019-12-15 12:52:34 -080025cc_library(
26 name = "log_namer",
27 srcs = ["log_namer.cc"],
28 hdrs = ["log_namer.h"],
29 copts = ["-Wno-format-nonliteral"],
30 visibility = ["//visibility:public"],
31 deps = [
32 "//aos:configuration",
33 "@com_github_google_glog//:glog",
34 ],
35)
36
Brian Silvermanf44f1242015-12-05 20:19:48 -050037cc_binary(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080038 name = "binary_log_writer",
39 srcs = [
40 "binary_log_writer.cc",
41 ],
42 visibility = ["//visibility:public"],
43 deps = [
44 ":binary_log_file",
45 ":implementations",
James Kuszmaul011b67a2019-12-15 12:52:34 -080046 ":log_namer",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080047 ":logging",
John Park398c74a2018-10-20 21:17:39 -070048 "//aos:configuration",
Austin Schuhdf6cbb12019-02-02 13:46:52 -080049 "//aos:die",
John Park398c74a2018-10-20 21:17:39 -070050 "//aos:init",
51 "//aos/ipc_lib:queue",
Austin Schuhdf6cbb12019-02-02 13:46:52 -080052 "//aos/time",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080053 ],
Brian Silvermanf44f1242015-12-05 20:19:48 -050054)
55
56cc_binary(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080057 name = "log_streamer",
58 srcs = [
59 "log_streamer.cc",
60 ],
61 visibility = ["//visibility:public"],
62 deps = [
63 ":implementations",
64 ":logging",
John Park398c74a2018-10-20 21:17:39 -070065 "//aos:init",
66 "//aos/ipc_lib:queue",
Austin Schuhdf6cbb12019-02-02 13:46:52 -080067 "//aos/time",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080068 ],
Brian Silvermanf44f1242015-12-05 20:19:48 -050069)
70
71cc_binary(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080072 name = "log_displayer",
73 srcs = [
74 "log_displayer.cc",
75 ],
76 visibility = ["//visibility:public"],
77 deps = [
78 ":binary_log_file",
79 ":implementations",
80 ":logging",
John Park398c74a2018-10-20 21:17:39 -070081 "//aos:configuration",
82 "//aos:init",
Austin Schuhdf6cbb12019-02-02 13:46:52 -080083 "//aos/util:string_to_num",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080084 ],
Brian Silvermanf44f1242015-12-05 20:19:48 -050085)
86
87cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080088 name = "binary_log_file",
89 srcs = [
90 "binary_log_file.cc",
91 ],
92 hdrs = [
93 "binary_log_file.h",
94 ],
95 deps = [
96 ":implementations",
97 ],
Austin Schuhf0736512015-09-07 01:22:16 -070098)
Brian Silverman100534c2015-09-07 15:51:23 -040099
100cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800101 name = "sizes",
102 hdrs = [
103 "sizes.h",
104 ],
Austin Schuh044e18b2015-10-21 20:17:09 -0700105)
106
Brian Silvermancb5da1f2015-12-05 22:19:58 -0500107cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800108 name = "implementations_test",
109 srcs = [
110 "implementations_test.cc",
111 ],
112 deps = [
113 ":implementations",
114 ":logging",
115 "//aos/testing:googletest",
116 ],
Brian Silvermancb5da1f2015-12-05 22:19:58 -0500117)
118
119cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800120 name = "printf_formats",
121 hdrs = [
122 "printf_formats.h",
123 ],
124 visibility = ["//visibility:public"],
125 deps = [
John Park33858a32018-09-28 23:05:48 -0700126 "//aos:macros",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800127 ],
Austin Schuh044e18b2015-10-21 20:17:09 -0700128)
129
130cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800131 name = "implementations",
132 srcs = [
133 "implementations.cc",
134 ],
135 hdrs = [
136 "implementations.h",
137 ],
138 linkopts = [
139 "-lpthread",
140 ],
141 visibility = ["//visibility:public"],
142 deps = [
143 ":logging",
Alex Perrycb7da4b2019-08-28 19:35:56 -0700144 ":printf_formats",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800145 ":sizes",
John Park33858a32018-09-28 23:05:48 -0700146 "//aos:die",
147 "//aos:macros",
John Park398c74a2018-10-20 21:17:39 -0700148 "//aos/ipc_lib:queue",
Austin Schuhdf6cbb12019-02-02 13:46:52 -0800149 "//aos/mutex",
150 "//aos/time",
151 "//aos/type_traits",
Austin Schuh8e17be92019-12-24 09:32:11 -0800152 "@com_google_absl//absl/base",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800153 ],
Brian Silvermanf480a612015-09-13 02:22:01 -0400154)
Tyler Chatow67ddb032020-01-12 14:30:04 -0800155
156flatbuffer_cc_library(
157 name = "log_message_fbs",
158 srcs = ["log_message.fbs"],
Tyler Chatow67ddb032020-01-12 14:30:04 -0800159 gen_reflections = 1,
Austin Schuha4f69d62020-02-28 13:58:14 -0800160 visibility = ["//visibility:public"],
Tyler Chatow67ddb032020-01-12 14:30:04 -0800161)