logging: Add rate limiting log macros
Summary: This adds several macros for explicitly rate-limited log messages. - `XLOG_EVERY_N()` logs only 1 of every N times it is called. This is similar to glog's `LOG_EVERY_N()` and `VLOG_EVERY_N()` macros. - `XLOG_EVERY_MS()` logs only once per specified time interval. This is similar to the `LOG_EVERY_MS()` and `LOG_EVERY_MS_ATOMIC()` macros that Facebook has defined internally on top of glog. - `XLOG_N_PER_MS()` logs the first N messages per specified time interval. These should make it easier for Facebook programs to migrate from glog to xlog. Reviewed By: yfeldblum Differential Revision: D8218663 fbshipit-source-id: a1e71265ace41fea95e5dbb79bc4381962b11297
Showing
Please register or sign in to comment