summaryrefslogtreecommitdiff
path: root/absl/log/globals.h
diff options
context:
space:
mode:
authorGravatar Andy Getzendanner <durandal@google.com>2023-04-18 00:29:00 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-04-18 00:30:06 -0700
commitf36183604eb90bb7a921721e445e6dacff9e25bb (patch)
tree79fce606f1a0ee903a57aebb0d09c4d0adcd5057 /absl/log/globals.h
parent387e1bf58c714e15ecba87c4b4673512afecf158 (diff)
Add an API to clear the saved LogBacktraceAt location, and call it when setting an empty or invalid flag value.
PiperOrigin-RevId: 525065479 Change-Id: I3c0822db8301e0999b0669394b415df82edd445f
Diffstat (limited to 'absl/log/globals.h')
-rw-r--r--absl/log/globals.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/absl/log/globals.h b/absl/log/globals.h
index 32b87db0..d56622ae 100644
--- a/absl/log/globals.h
+++ b/absl/log/globals.h
@@ -110,8 +110,8 @@ class ScopedStderrThreshold final {
// Log Backtrace At
//------------------------------------------------------------------------------
//
-// Users can request backtrace to be logged at specific locations, specified
-// by file and line number.
+// Users can request an existing `LOG` statement, specified by file and line
+// number, to also include a backtrace when logged.
// ShouldLogBacktraceAt()
//
@@ -123,9 +123,16 @@ ABSL_MUST_USE_RESULT bool ShouldLogBacktraceAt(absl::string_view file,
// SetLogBacktraceLocation()
//
-// Sets the location the backtrace should be logged at.
+// Sets the location the backtrace should be logged at. If the specified
+// location isn't a `LOG` statement, the effect will be the same as
+// `ClearLogBacktraceLocation` (but less efficient).
void SetLogBacktraceLocation(absl::string_view file, int line);
+// ClearLogBacktraceLocation()
+//
+// Clears the set location so that backtraces will no longer be logged at it.
+void ClearLogBacktraceLocation();
+
//------------------------------------------------------------------------------
// Prepend Log Prefix
//------------------------------------------------------------------------------