let debprint fmt = if (!debug) then Printf.fprintf logfd (fmt ^^ "%!")