aboutsummaryrefslogtreecommitdiff
path: root/absl/flags/marshalling.cc
diff options
context:
space:
mode:
authorAndy Getzendanner <durandal@google.com>2023-12-21 12:00:50 -0800
committerCopybara-Service <copybara-worker@google.com>2023-12-21 12:01:50 -0800
commit8184f16e898fcb13b310b40430e13ba40679cf0e (patch)
tree2216371d4feb7f6e1bc3c1721764180872cfd0f9 /absl/flags/marshalling.cc
parent258e5a15759cc3d122d4a4826bc499af91d40aa9 (diff)
downloadabseil-8184f16e898fcb13b310b40430e13ba40679cf0e.tar.gz
abseil-8184f16e898fcb13b310b40430e13ba40679cf0e.tar.bz2
abseil-8184f16e898fcb13b310b40430e13ba40679cf0e.zip
Release a few bits and pieces of DFATAL that were left behind: flag parsing & some tests.
PiperOrigin-RevId: 592918704 Change-Id: Iacef0e069c012a04960211c032454244822f9634
Diffstat (limited to 'absl/flags/marshalling.cc')
-rw-r--r--absl/flags/marshalling.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/absl/flags/marshalling.cc b/absl/flags/marshalling.cc
index dc69754f..ca4a1305 100644
--- a/absl/flags/marshalling.cc
+++ b/absl/flags/marshalling.cc
@@ -247,6 +247,14 @@ bool AbslParseFlag(absl::string_view text, absl::LogSeverity* dst,
*err = "no value provided";
return false;
}
+ if (absl::EqualsIgnoreCase(text, "dfatal")) {
+ *dst = absl::kLogDebugFatal;
+ return true;
+ }
+ if (absl::EqualsIgnoreCase(text, "klogdebugfatal")) {
+ *dst = absl::kLogDebugFatal;
+ return true;
+ }
if (text.front() == 'k' || text.front() == 'K') text.remove_prefix(1);
if (absl::EqualsIgnoreCase(text, "info")) {
*dst = absl::LogSeverity::kInfo;
@@ -269,7 +277,8 @@ bool AbslParseFlag(absl::string_view text, absl::LogSeverity* dst,
*dst = static_cast<absl::LogSeverity>(numeric_value);
return true;
}
- *err = "only integers and absl::LogSeverity enumerators are accepted";
+ *err =
+ "only integers, absl::LogSeverity enumerators, and DFATAL are accepted";
return false;
}