History log of /system/core/liblog/log_ratelimit.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2ed51d708eda64516ec79ac6397f690de38f0075 09-Mar-2017 Mark Salyzyn <salyzyn@google.com> liblog: specify clang format

Switch coding style to match

SideEffects: None
Test: compile
Bug: 27405083
Change-Id: Id426d5c5e3b18f2ceec22b31bbc9781aabf6bcca
/system/core/liblog/log_ratelimit.cpp
fc148f7f3371ccc0584261dd0b2462c09798d4f8 14-Dec-2016 Mark Salyzyn <salyzyn@google.com> 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
/system/core/liblog/log_ratelimit.cpp