Make saveLog more generic, will reuse it for saving coordinator readings
Fix bug in input length check