blob: cf0c3700c7a2ebf090741f3820eea7b569fe5326 [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",
Austin Schuha0c41ba2020-09-10 22:59:14 -07008 "implementations.cc",
Philipp Schrader9b1790e2018-03-10 20:21:30 -08009 "interface.cc",
10 ],
11 hdrs = [
12 "context.h",
Austin Schuha0c41ba2020-09-10 22:59:14 -070013 "implementations.h",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080014 "interface.h",
15 "logging.h",
16 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080017 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080018 visibility = ["//visibility:public"],
19 deps = [
Austin Schuha0c41ba2020-09-10 22:59:14 -070020 ":printf_formats",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080021 ":sizes",
Austin Schuhdf6cbb12019-02-02 13:46:52 -080022 "//aos:complex_thread_local",
John Park33858a32018-09-28 23:05:48 -070023 "//aos:die",
24 "//aos:macros",
Brian Silvermanb47f5552020-10-01 15:08:14 -070025 "//aos:thread_local",
John Park33858a32018-09-28 23:05:48 -070026 "//aos/libc:aos_strerror",
Austin Schuha0c41ba2020-09-10 22:59:14 -070027 "//aos/stl_mutex",
28 "//aos/time",
29 "//aos/type_traits",
Brian Silverman1463c092020-10-30 17:28:24 -070030 "@com_github_google_glog//:glog",
Austin Schuha0c41ba2020-09-10 22:59:14 -070031 "@com_google_absl//absl/base",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080032 ],
Brian Silvermancb5da1f2015-12-05 22:19:58 -050033)
Austin Schuhf0736512015-09-07 01:22:16 -070034
James Kuszmaul011b67a2019-12-15 12:52:34 -080035cc_library(
36 name = "log_namer",
37 srcs = ["log_namer.cc"],
38 hdrs = ["log_namer.h"],
39 copts = ["-Wno-format-nonliteral"],
Philipp Schraderdada1072020-11-24 11:34:46 -080040 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul011b67a2019-12-15 12:52:34 -080041 visibility = ["//visibility:public"],
42 deps = [
43 "//aos:configuration",
44 "@com_github_google_glog//:glog",
45 ],
46)
47
Brian Silverman100534c2015-09-07 15:51:23 -040048cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080049 name = "sizes",
50 hdrs = [
51 "sizes.h",
52 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080053 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh044e18b2015-10-21 20:17:09 -070054)
55
Brian Silvermancb5da1f2015-12-05 22:19:58 -050056cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080057 name = "implementations_test",
58 srcs = [
59 "implementations_test.cc",
60 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080061 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080062 deps = [
63 ":implementations",
64 ":logging",
65 "//aos/testing:googletest",
Brian Silverman1463c092020-10-30 17:28:24 -070066 "@com_github_google_glog//:glog",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080067 ],
Brian Silvermancb5da1f2015-12-05 22:19:58 -050068)
69
70cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080071 name = "printf_formats",
72 hdrs = [
73 "printf_formats.h",
74 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080075 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080076 visibility = ["//visibility:public"],
77 deps = [
John Park33858a32018-09-28 23:05:48 -070078 "//aos:macros",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080079 ],
Austin Schuh044e18b2015-10-21 20:17:09 -070080)
81
82cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080083 name = "implementations",
Philipp Schraderdada1072020-11-24 11:34:46 -080084 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080085 visibility = ["//visibility:public"],
86 deps = [
87 ":logging",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080088 ],
Brian Silvermanf480a612015-09-13 02:22:01 -040089)
Tyler Chatow67ddb032020-01-12 14:30:04 -080090
91flatbuffer_cc_library(
92 name = "log_message_fbs",
93 srcs = ["log_message.fbs"],
Tyler Chatow67ddb032020-01-12 14:30:04 -080094 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080095 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha4f69d62020-02-28 13:58:14 -080096 visibility = ["//visibility:public"],
Tyler Chatow67ddb032020-01-12 14:30:04 -080097)