went through and made sure all writes to log_file ensured it was actually opened
tried to implement exceptions, but the compiler kept being an asshole