Set exception hook in setup_logger and in MPI-based classes.