diff options
| author | Mark Salyzyn <salyzyn@google.com> | 2016-12-14 12:52:50 -0800 |
|---|---|---|
| committer | Mark Salyzyn <salyzyn@google.com> | 2016-12-21 21:36:14 +0000 |
| commit | 20b8c52bc2d3bd3e3bb0d9b9958e6dd1c37148e5 (patch) | |
| tree | 7726843bc189788cbab5b1ca7342ca76e613eea3 /libutils/Unicode.cpp | |
| parent | 55f503e5b3d34110f09b1c727a131a51a687b9b8 (diff) | |
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 'libutils/Unicode.cpp')
0 files changed, 0 insertions, 0 deletions
