Skip to content

Commit ebe8595

Browse files
committed
Improve logging for Safe Events Indexer
1 parent 15e7694 commit ebe8595

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

safe_transaction_service/history/indexers/safe_events_indexer.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def _get_internal_tx_from_decoded_event(
346346
if hasattr(internal_tx, key):
347347
setattr(internal_tx, key, value)
348348
else:
349-
raise AttributeError(f"Invalid atribute {key} for InternalTx")
349+
raise AttributeError(f"Invalid attribute {key} for InternalTx")
350350

351351
return internal_tx
352352

@@ -362,15 +362,32 @@ def _process_decoded_element(
362362
args = dict(decoded_element["args"])
363363
ethereum_tx_hash = HexBytes(decoded_element["transactionHash"])
364364
ethereum_tx_hash_hex = to_0x_hex_str(ethereum_tx_hash)
365+
366+
logger.debug(
367+
"[%s] %s - tx-hash=%s - Processing event %s",
368+
safe_address,
369+
event_name,
370+
ethereum_tx_hash_hex,
371+
decoded_element,
372+
)
373+
374+
logger.debug(
375+
"[%s] %s - tx-hash=%s - Retrieving timestamp for block with hash %s",
376+
safe_address,
377+
event_name,
378+
ethereum_tx_hash_hex,
379+
to_0x_hex_str(decoded_element["blockHash"]),
380+
)
381+
365382
ethereum_block_timestamp = EthereumBlock.objects.get_timestamp_by_hash(
366383
decoded_element["blockHash"]
367384
)
385+
368386
logger.debug(
369-
"[%s] %s - tx-hash=%s - Processing event %s",
387+
"[%s] %s - tx-hash=%s - Retrieved timestamp for block",
370388
safe_address,
371389
event_name,
372390
ethereum_tx_hash_hex,
373-
decoded_element,
374391
)
375392

376393
internal_tx = self._get_internal_tx_from_decoded_event(
@@ -461,6 +478,12 @@ def _process_decoded_element(
461478
# 'ExecutionFromModuleSuccess', 'ExecutionFromModuleFailure'
462479
internal_tx_decoded = None
463480

481+
logger.debug(
482+
"[%s] %s - tx-hash=%s - Storing processed event in the DB",
483+
safe_address,
484+
event_name,
485+
ethereum_tx_hash_hex,
486+
)
464487
if internal_tx:
465488
with transaction.atomic():
466489
try:

0 commit comments

Comments
 (0)