summaryrefslogtreecommitdiff
path: root/absl/log/flags.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/log/flags.cc')
-rw-r--r--absl/log/flags.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/absl/log/flags.cc b/absl/log/flags.cc
index 215b7bd5..dfb0d8e6 100644
--- a/absl/log/flags.cc
+++ b/absl/log/flags.cc
@@ -28,6 +28,7 @@
#include "absl/flags/marshalling.h"
#include "absl/log/globals.h"
#include "absl/log/internal/config.h"
+#include "absl/log/vlog_config.h"
#include "absl/strings/numbers.h"
#include "absl/strings/string_view.h"
@@ -118,3 +119,25 @@ ABSL_FLAG(bool, log_prefix, true,
.OnUpdate([] {
absl::log_internal::RawEnableLogPrefix(absl::GetFlag(FLAGS_log_prefix));
});
+
+ABSL_FLAG(int, v, 0,
+ "Show all VLOG(m) messages for m <= this. Overridable by --vmodule.")
+ .OnUpdate([] {
+ absl::log_internal::UpdateGlobalVLogLevel(absl::GetFlag(FLAGS_v));
+ });
+
+ABSL_FLAG(
+ std::string, vmodule, "",
+ "per-module log verbosity level."
+ " Argument is a comma-separated list of <module name>=<log level>."
+ " <module name> is a glob pattern, matched against the filename base"
+ " (that is, name ignoring .cc/.h./-inl.h)."
+ " A pattern without slashes matches just the file name portion, otherwise"
+ " the whole file path below the workspace root"
+ " (still without .cc/.h./-inl.h) is matched."
+ " ? and * in the glob pattern match any single or sequence of characters"
+ " respectively including slashes."
+ " <log level> overrides any value given by --v.")
+ .OnUpdate([] {
+ absl::log_internal::UpdateVModule(absl::GetFlag(FLAGS_vmodule));
+ });