Similar to XLOG(...) except only log a message every
Declared in <folly/logging/xlog.h>
#define XLOG_EVERY_N_THREAD(level, n, ...)
The internal counter is thread-local, avoiding the contention which the XLOG_EVERY_N variations which use a global counter may suffer. If a given XLOG_EVERY_N or variation expansion is encountered concurrently by multiple threads in a hot code path and the global counter in the expansion is observed to be contended, then switching to XLOG_EVERY_N_THREAD can help.
Every thread that invokes this expansion has a counter for this expansion. The internal counters are all stored in a single thread-local map to control TLS overhead, at the cost of a small runtime performance hit.
| Name | Description |
|---|---|
| n | invocations per thread. |
| level | The folly::LogLevel value at which to log. |