Skip to content

logging.py

Logging configuration based on datajoint/logging.py

excepthook(exc_type, exc_value, exc_traceback)

Accommodate KeyboardInterrupt exception.

Source code in src/spyglass/utils/logging.py
def excepthook(exc_type, exc_value, exc_traceback):
    """Accommodate KeyboardInterrupt exception."""
    if issubclass(exc_type, KeyboardInterrupt):
        sys.__excepthook__(exc_type, exc_value, exc_traceback)
        return

    logger.error(
        "Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback)
    )