MCPcopy Create free account
hub / github.com/apify/crawlee-python / log

Method log

src/crawlee/_utils/log.py:18–29  ·  view source on GitHub ↗

Log `message` at `level` the first time `key` is seen on this instance; later calls are no-ops. Args: message: The message to log. key: Deduplication key. Two calls with the same key emit at most once. level: Standard `logging` level (e.g. `logging.WARNIN

(self, message: str, *, key: str, level: int = logging.INFO)

Source from the content-addressed store, hash-verified

16 self._seen: set[str] = set()
17
18 def log(self, message: str, *, key: str, level: int = logging.INFO) -> None:
19 """Log `message` at `level` the first time `key` is seen on this instance; later calls are no-ops.
20
21 Args:
22 message: The message to log.
23 key: Deduplication key. Two calls with the same key emit at most once.
24 level: Standard `logging` level (e.g. `logging.WARNING`). Defaults to `logging.INFO`.
25 """
26 if key in self._seen:
27 return
28 self._seen.add(key)
29 self._logger.log(level, message)

Callers 13

test_first_call_logsFunction · 0.95
_snapshot_memoryMethod · 0.45
emitMethod · 0.45
requestHandlerFunction · 0.45
emitMethod · 0.45
emitMethod · 0.45

Calls 1

addMethod · 0.45