summaryrefslogtreecommitdiff
path: root/absl/log/BUILD.bazel
diff options
context:
space:
mode:
Diffstat (limited to 'absl/log/BUILD.bazel')
-rw-r--r--absl/log/BUILD.bazel83
1 files changed, 83 insertions, 0 deletions
diff --git a/absl/log/BUILD.bazel b/absl/log/BUILD.bazel
index 40c1bfbc..cb069381 100644
--- a/absl/log/BUILD.bazel
+++ b/absl/log/BUILD.bazel
@@ -50,6 +50,7 @@ cc_library(
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
+ ":vlog_is_on",
"//absl/log/internal:log_impl",
],
)
@@ -91,6 +92,7 @@ cc_library(
visibility = ["//visibility:public"],
deps = [
":globals",
+ ":vlog_config",
"//absl/base:config",
"//absl/base:core_headers",
"//absl/base:log_severity",
@@ -143,6 +145,7 @@ cc_library(
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
+ ":vlog_is_on",
"//absl/log/internal:log_impl",
],
)
@@ -235,6 +238,86 @@ cc_library(
],
)
+cc_library(
+ name = "vlog_config",
+ srcs = ["vlog_config.cc"],
+ hdrs = ["vlog_config.h"],
+ copts = ABSL_DEFAULT_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ visibility = ["//visibility:private"],
+ deps = [
+ "//absl/base",
+ "//absl/base:config",
+ "//absl/base:core_headers",
+ "//absl/log/internal:fnmatch",
+ "//absl/memory",
+ "//absl/strings",
+ "//absl/synchronization",
+ "//absl/types:optional",
+ ],
+)
+
+cc_library(
+ name = "vlog_is_on",
+ hdrs = ["vlog_is_on.h"],
+ copts = ABSL_DEFAULT_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ visibility = [
+ "//absl/log:__subpackages__",
+ ],
+ deps = [
+ ":vlog_config",
+ "//absl/base:config",
+ "//absl/base:core_headers",
+ "//absl/strings",
+ ],
+)
+
+# TODO(b/200695798): run this in TAP projects with -DABSL_MAX_VLOG_VERBOSITY={-100,100}
+cc_test(
+ name = "vlog_is_on_test",
+ size = "small",
+ srcs = [
+ "vlog_is_on_test.cc",
+ ],
+ copts = ABSL_TEST_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ deps = [
+ ":flags",
+ ":log",
+ ":scoped_mock_log",
+ ":vlog_is_on",
+ "//absl/base:log_severity",
+ "//absl/flags:flag",
+ "//absl/types:optional",
+ "@com_google_googletest//:gtest",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_test(
+ name = "vlog_config_benchmark",
+ size = "medium",
+ srcs = ["vlog_config_benchmark.cc"],
+ copts = ABSL_TEST_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ tags = [
+ "benchmark",
+ "no_test_loonix",
+ "notsan",
+ ],
+ deps = [
+ ":vlog_config",
+ "//absl/base:config",
+ "//absl/base:core_headers",
+ "//absl/container:layout",
+ "//absl/memory",
+ "//absl/random:distributions",
+ "//absl/strings",
+ "@com_github_google_benchmark//:benchmark_main",
+ ],
+)
+
# Test targets
cc_test(