Changed logging (added newline), and removed encoding specifier in opening debug file