let debug s = 
  if !debug_flag || is_current_task_traced () then 
    (output_string stderr (s ^ "\n"); flush stderr)