summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2016-12-14 14:52:50 -0600
committerMark Salyzyn2016-12-21 15:36:14 -0600
commitfc148f7f3371ccc0584261dd0b2462c09798d4f8 (patch)
tree7726843bc189788cbab5b1ca7342ca76e613eea3 /liblog/Android.bp
parent8a1c4b85303cd636f4920f99093063f57ecc8e73 (diff)
downloadplatform-system-core-fc148f7f3371ccc0584261dd0b2462c09798d4f8.tar.gz
platform-system-core-fc148f7f3371ccc0584261dd0b2462c09798d4f8.tar.xz
platform-system-core-fc148f7f3371ccc0584261dd0b2462c09798d4f8.zip
liblog: add IF_ALOG_RATELIMIT
IF_ALOG_RATELIMIT() ALOGE("Only one message globally using IF_ALOG_RATELIMIT()" " in the process may appear ever ten seconds," " (%s)", strerror(errno)); static time_t last; /* initial state zero */ IF_ALOG_RATELIMIT_LOCAL(60, &last) ALOGE("Only one message locally may appear every minute," " (%s)", strerror(errno)); These new calls are guaranteed not to affect the value of a non-zero errno to simplify logging of errors. However, the ALOGE calls in the above examples may update the errno value upon their return. Test: gTest liblog-unit-tests --gtest_filter=liblog.__android_log_ratelimit Bug: 33535908 Change-Id: Id8cc192fc7d14504ffd418933cf88ae945c089f2
Diffstat (limited to 'liblog/Android.bp')
-rw-r--r--liblog/Android.bp1
1 files changed, 1 insertions, 0 deletions
diff --git a/liblog/Android.bp b/liblog/Android.bp
index 2424dba75..be47fc333 100644
--- a/liblog/Android.bp
+++ b/liblog/Android.bp
@@ -21,6 +21,7 @@ liblog_sources = [
21 "config_write.c", 21 "config_write.c",
22 "logger_name.c", 22 "logger_name.c",
23 "logger_lock.c", 23 "logger_lock.c",
24 "log_ratelimit.cpp",
24] 25]
25liblog_host_sources = [ 26liblog_host_sources = [
26 "fake_log_device.c", 27 "fake_log_device.c",