added a check for logging in the read_compressed function.