logfile_writer&reader code