print error when preamble method fails
extract method writeMeasurementFile