let output t ?status (stdout:Buffer.t) st =
    let msg = Buffer.contents stdout in
    begin
      log_status t st ;
      Format.pp_print_string t.logfmt msg ;
      Format.pp_print_newline t.logfmt () ;
      if is_error ?status st then
        begin
          let cname = match t.logcmd with None -> "<?>" | Some (cmd,_) -> cmd in
          Wp_parameters.error "command '%s' failed." cname ;
          if not !Config.is_gui then
            Log.print_on_output (fun fmt -> Format.fprintf fmt "%a%s" pp_current t msg) ;
        end
    end