Log 'msg % args' at level 'level' only first 'n' times. 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: The args to be substituted into the msg.
(level, msg, n, *args)
| 170 | |
| 171 | |
| 172 | def log_first_n(level, msg, n, *args): # pylint: disable=g-bad-name |
| 173 | """Log 'msg % args' at level 'level' only first 'n' times. |
| 174 | |
| 175 | Not threadsafe. |
| 176 | |
| 177 | Args: |
| 178 | level: The level at which to log. |
| 179 | msg: The message to be logged. |
| 180 | n: The number of times this should be called before it is logged. |
| 181 | *args: The args to be substituted into the msg. |
| 182 | """ |
| 183 | count = _GetNextLogCountPerToken(_GetFileAndLine()) |
| 184 | log_if(level, msg, count < n, *args) |
| 185 | |
| 186 | |
| 187 | def log_if(level, msg, condition, *args): |
nothing calls this directly
no test coverage detected
searching dependent graphs…