fp_write_log supports outputing multiple log types, added mutex prints
added some more prints, fixed peek deadlock bug