blob: 30fd0d10a592726aa4972629be34da93393d5da1 [file] [log] [blame]
Tyler Chatow67ddb032020-01-12 14:30:04 -08001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
Austin Schuha9df9ad2021-06-16 14:49:39 -07002load("//aos:flatbuffers.bzl", "cc_static_flatbuffer")
Tyler Chatow67ddb032020-01-12 14:30:04 -08003
Brian Silvermancb5da1f2015-12-05 22:19:58 -05004# The primary client logging interface.
5cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -08006 name = "logging",
7 srcs = [
8 "context.cc",
Austin Schuha0c41ba2020-09-10 22:59:14 -07009 "implementations.cc",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080010 "interface.cc",
11 ],
12 hdrs = [
13 "context.h",
Austin Schuha0c41ba2020-09-10 22:59:14 -070014 "implementations.h",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080015 "interface.h",
16 "logging.h",
17 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080018 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080019 visibility = ["//visibility:public"],
20 deps = [
Austin Schuha0c41ba2020-09-10 22:59:14 -070021 ":printf_formats",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080022 ":sizes",
Austin Schuhdf6cbb12019-02-02 13:46:52 -080023 "//aos:complex_thread_local",
John Park33858a32018-09-28 23:05:48 -070024 "//aos:die",
25 "//aos:macros",
Brian Silvermanb47f5552020-10-01 15:08:14 -070026 "//aos:thread_local",
John Park33858a32018-09-28 23:05:48 -070027 "//aos/libc:aos_strerror",
Austin Schuha0c41ba2020-09-10 22:59:14 -070028 "//aos/stl_mutex",
29 "//aos/time",
30 "//aos/type_traits",
Brian Silverman1463c092020-10-30 17:28:24 -070031 "@com_github_google_glog//:glog",
Austin Schuha0c41ba2020-09-10 22:59:14 -070032 "@com_google_absl//absl/base",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080033 ],
Brian Silvermancb5da1f2015-12-05 22:19:58 -050034)
Austin Schuhf0736512015-09-07 01:22:16 -070035
James Kuszmaul011b67a2019-12-15 12:52:34 -080036cc_library(
37 name = "log_namer",
38 srcs = ["log_namer.cc"],
39 hdrs = ["log_namer.h"],
40 copts = ["-Wno-format-nonliteral"],
Philipp Schraderdada1072020-11-24 11:34:46 -080041 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul011b67a2019-12-15 12:52:34 -080042 visibility = ["//visibility:public"],
43 deps = [
44 "//aos:configuration",
45 "@com_github_google_glog//:glog",
46 ],
47)
48
Brian Silverman100534c2015-09-07 15:51:23 -040049cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080050 name = "sizes",
51 hdrs = [
52 "sizes.h",
53 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080054 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh044e18b2015-10-21 20:17:09 -070055)
56
Brian Silvermancb5da1f2015-12-05 22:19:58 -050057cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080058 name = "implementations_test",
59 srcs = [
60 "implementations_test.cc",
61 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080062 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080063 deps = [
64 ":implementations",
65 ":logging",
66 "//aos/testing:googletest",
Brian Silverman1463c092020-10-30 17:28:24 -070067 "@com_github_google_glog//:glog",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080068 ],
Brian Silvermancb5da1f2015-12-05 22:19:58 -050069)
70
71cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080072 name = "printf_formats",
73 hdrs = [
74 "printf_formats.h",
75 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080076 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080077 visibility = ["//visibility:public"],
78 deps = [
John Park33858a32018-09-28 23:05:48 -070079 "//aos:macros",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080080 ],
Austin Schuh044e18b2015-10-21 20:17:09 -070081)
82
83cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -080084 name = "implementations",
Philipp Schraderdada1072020-11-24 11:34:46 -080085 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -080086 visibility = ["//visibility:public"],
87 deps = [
88 ":logging",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080089 ],
Brian Silvermanf480a612015-09-13 02:22:01 -040090)
Tyler Chatow67ddb032020-01-12 14:30:04 -080091
92flatbuffer_cc_library(
93 name = "log_message_fbs",
94 srcs = ["log_message.fbs"],
Tyler Chatow67ddb032020-01-12 14:30:04 -080095 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080096 target_compatible_with = ["@platforms//os:linux"],
Austin Schuha4f69d62020-02-28 13:58:14 -080097 visibility = ["//visibility:public"],
Tyler Chatow67ddb032020-01-12 14:30:04 -080098)
Austin Schuha9df9ad2021-06-16 14:49:39 -070099
100cc_static_flatbuffer(
101 name = "log_message_schema",
102 function = "aos::logging::LogMessageFbsSchema",
103 target = ":log_message_fbs_reflection_out",
104 visibility = ["//visibility:public"],
105)