MCPcopy Index your code
hub / github.com/tensorlayer/TensorLayer / log_every_n

Function log_every_n

tensorlayer/logging/tl_logging.py:156–169  ·  view source on GitHub ↗

Log 'msg % args' at level 'level' once per 'n' times. Logs the 1st call, (N+1)st call, (2N+1)st call, etc. Not threadsafe. Args: level: The level at which to log. msg: The message to be logged. n: The number of times this should be called before it is logged. *args: Th

(level, msg, n, *args)

Source from the content-addressed store, hash-verified

154
155
156def log_every_n(level, msg, n, *args):
157 """Log 'msg % args' at level 'level' once per 'n' times.
158
159 Logs the 1st call, (N+1)st call, (2N+1)st call, etc.
160 Not threadsafe.
161
162 Args:
163 level: The level at which to log.
164 msg: The message to be logged.
165 n: The number of times this should be called before it is logged.
166 *args: The args to be substituted into the msg.
167 """
168 count = _GetNextLogCountPerToken(_GetFileAndLine())
169 log_if(level, msg, not (count % n), *args)
170
171
172def log_first_n(level, msg, n, *args): # pylint: disable=g-bad-name

Callers

nothing calls this directly

Calls 3

_GetNextLogCountPerTokenFunction · 0.85
_GetFileAndLineFunction · 0.85
log_ifFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…