MCPcopy
hub / github.com/Gallopsled/pwntools / warning_once

Method warning_once

pwnlib/log.py:367–376  ·  view source on GitHub ↗

warning_once(message, *args, **kwargs) Logs a warning message. The same message is never printed again.

(self, message, *args, **kwargs)

Source from the content-addressed store, hash-verified

365 self._log(logging.INFO, message, args, kwargs, 'info_once')
366
367 def warning_once(self, message, *args, **kwargs):
368 """warning_once(message, *args, **kwargs)
369
370 Logs a warning message. The same message is never printed again.
371 """
372 m = message % args
373 if m not in self._one_time_warnings:
374 if self.isEnabledFor(logging.WARNING):
375 self._one_time_warnings.add(m)
376 self._log(logging.WARNING, message, args, kwargs, 'warning_once')
377
378 def warn_once(self, *args, **kwargs):
379 """Alias for :meth:`warning_once`."""

Callers 4

warn_onceMethod · 0.95
encodeFunction · 0.80
systemMethod · 0.80
run_to_endMethod · 0.80

Calls 3

isEnabledForMethod · 0.95
_logMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected