diff --git a/cpdctrl/measurement.py b/cpdctrl/measurement.py index 94703ba..bdb08bc 100644 --- a/cpdctrl/measurement.py +++ b/cpdctrl/measurement.py @@ -154,18 +154,17 @@ def measure( led_dev.set_level(new_led_val) led_val = new_led_val except Exception as e: - log.error(f"Error setting led to {new_led_val:03}%: {e}") - raise e + log.error("Error setting led to {new_led_val}%: {e}") except KeyboardInterrupt: - log.info("Keyboard interrupt, stopping measurement") + log.info("Keyboard interrupt, stopping") except Exception as e: - log.critical(f"Unexpected error, stopping measurement. Error: {e}") + log.critical(f"Unexpected error, stopping. Error: {e}") if add_measurement_info_to_metadata: data.metadata["measurement_time_stop"] = get_time() # Write again after having updated the stop time data.write_metadata() - data.flush() + data.flush(verbose=verbose) led_dev.off()