summaryrefslogtreecommitdiff
path: root/absl/log/globals.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2023-04-18 10:05:16 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-04-18 10:06:01 -0700
commit2d04ec1da212035cb2dd2576af60db4aa3f7bb72 (patch)
treedbff2ca6ebe18ddaeb6a6e0de6b8d4b5520604e8 /absl/log/globals.h
parentf36183604eb90bb7a921721e445e6dacff9e25bb (diff)
Add configurability of the log Tag value on Android
PiperOrigin-RevId: 525178448 Change-Id: I0f35a38f23316b25621148b7fe59becf72bafeff
Diffstat (limited to 'absl/log/globals.h')
-rw-r--r--absl/log/globals.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/absl/log/globals.h b/absl/log/globals.h
index d56622ae..bc3864c1 100644
--- a/absl/log/globals.h
+++ b/absl/log/globals.h
@@ -152,6 +152,29 @@ ABSL_MUST_USE_RESULT bool ShouldPrependLogPrefix();
// This function is async-signal-safe.
void EnableLogPrefix(bool on_off);
+//------------------------------------------------------------------------------
+// Configure Android Native Log Tag
+//------------------------------------------------------------------------------
+//
+// The logging library forwards to the Android system log API when built for
+// Android. That API takes a string "tag" value in addition to a message and
+// severity level. The tag is used to identify the source of messages and to
+// filter them. This library uses the tag "native" by default.
+
+// SetAndroidNativeTag()
+//
+// Stores a copy of the string pointed to by `tag` and uses it as the Android
+// logging tag thereafter. `tag` must not be null.
+// This function must not be called more than once!
+void SetAndroidNativeTag(const char* tag);
+
+namespace log_internal {
+// GetAndroidNativeTag()
+//
+// Returns the configured Android logging tag.
+const char* GetAndroidNativeTag();
+} // namespace log_internal
+
namespace log_internal {
using LoggingGlobalsListener = void (*)();