mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-09-05 02:24:21 -05:00
* Send coin_added event to metrics * Add fingerprint to balance response * Don't consume the exception by default, but enable for the metrics data usecases * Pass sync_changed event to metrics * bare raise
14 lines
328 B
Python
14 lines
328 B
Python
from contextlib import contextmanager
|
|
import logging
|
|
import traceback
|
|
|
|
|
|
@contextmanager
|
|
def log_exceptions(log: logging.Logger, *, consume: bool = False):
|
|
try:
|
|
yield
|
|
except Exception as e:
|
|
log.error(f"Caught Exception: {e}. Traceback: {traceback.format_exc()}")
|
|
if not consume:
|
|
raise
|