liblog: Add android_set_log_frontend
android_set_log_frontend allows one to select LOGGER_DEFAULT,
LOGGER_LOGD or LOGGER_NULL, the latter allows a runtime mechanism to
turn logging on or off. LOGGER_DEFAULT is LOGGER_LOGD.
Test: gTest liblog-unit-tests notably liblog.android_set_log_frontend
and liblog-benchmarks before and after.
Bug: 27405083
Change-Id: I365dbee9f7d83112da0ef8d1cace748d247773c8
diff --git a/liblog/README b/liblog/README
index 610338c..922b5e3 100644
--- a/liblog/README
+++ b/liblog/README
@@ -108,6 +108,11 @@
int android_log_destroy(android_log_context *ctx)
+ #include <log/log_frontend.h>
+
+ int android_set_log_frontend(int frontend_flag)
+ int android_get_log_frontend()
+
Link with -llog
DESCRIPTION
@@ -162,6 +167,12 @@
when opening the sub-log. It is recommended to open the log
ANDROID_LOG_RDONLY in these cases.
+ android_set_log_frontend() selects frontend filters. Argument is either
+ LOGGER_DEFAULT, LOGGER_LOGD or LOGGER_NULL. The latter drops all
+ content on the floor. Both android_set_log_frontend() and
+ android_get_log_frontend() return the current frontend mask, or a
+ negative errno for any problems.
+
ERRORS
If messages fail, a negative error code will be returned to the caller.
@@ -194,4 +205,4 @@
- 17 Oct 2016 LIBLOG(3)
+ 08 Feb 2017 LIBLOG(3)