[#XLOG_EVERY_N_THREAD]
= XLOG&lowbar;EVERY&lowbar;N&lowbar;THREAD
:mrdocs:

Similar to XLOG(&period;&period;&period;) except only log a message every

== Synopsis

Declared in `&lt;folly&sol;logging&sol;xlog&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
#define XLOG&lowbar;EVERY&lowbar;N&lowbar;THREAD(level, n, ...)

----

== Description

The internal counter is thread&hyphen;local, avoiding the contention which the XLOG&lowbar;EVERY&lowbar;N variations which use a global counter may suffer&period; If a given XLOG&lowbar;EVERY&lowbar;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&lowbar;EVERY&lowbar;N&lowbar;THREAD can help&period;

Every thread that invokes this expansion has a counter for this expansion&period; The internal counters are all stored in a single thread&hyphen;local map to control TLS overhead, at the cost of a small runtime performance hit&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *n*
| invocations per thread&period;
| *level*
| The `folly&colon;&colon;LogLevel` value at which to log&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
