MCPcopy Create free account
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / warning_once

Function warning_once

scrapegraphai/utils/logging.py:215–227  ·  view source on GitHub ↗

Emit a warning log with the same message only once. This function is added as a method to the logging.Logger class. It emits a warning log with the same message only once, even if it is called multiple times with the same message. Args: *args: The arguments to pass to

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

213
214@lru_cache(None)
215def warning_once(self, *args, **kwargs):
216 """
217 Emit a warning log with the same message only once.
218
219 This function is added as a method to the logging.Logger class.
220 It emits a warning log with the same message only once,
221 even if it is called multiple times with the same message.
222
223 Args:
224 *args: The arguments to pass to the logging.Logger.warning method.
225 **kwargs: The keyword arguments to pass to the logging.Logger.warning method.
226 """
227 self.warning(*args, **kwargs)
228
229
230logging.Logger.warning_once = warning_once

Callers

nothing calls this directly

Calls 1

warningMethod · 0.80

Tested by

no test coverage detected