From: Stefano Zacchiroli Date: Thu, 3 Feb 2005 22:18:26 +0000 (+0000) Subject: added warn and error for messaging X-Git-Tag: V_0_1_0~46 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=a4111d1db614ce04dce3f0b242939c3fc05e7ce5;p=helm.git added warn and error for messaging --- diff --git a/helm/DEVEL/ocaml-http/http_misc.ml b/helm/DEVEL/ocaml-http/http_misc.ml index fcec70ca5..c4c9cfea9 100644 --- a/helm/DEVEL/ocaml-http/http_misc.ml +++ b/helm/DEVEL/ocaml-http/http_misc.ml @@ -19,7 +19,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *) -open Http_types;; +open Printf + +open Http_types let date_822 () = Netdate.mk_mail_date ~zone:Netdate.localzone (Unix.time ()) @@ -139,3 +141,6 @@ let buf_of_inchan ?limit ic = let list_assoc_all key pairs = snd (List.split (List.filter (fun (k, v) -> k = key) pairs)) +let warn msg = prerr_endline (sprintf "ocaml-http WARNING: %s" msg) +let error msg = prerr_endline (sprintf "ocaml-http ERROR: %s" msg) + diff --git a/helm/DEVEL/ocaml-http/http_misc.mli b/helm/DEVEL/ocaml-http/http_misc.mli index b5972f830..914b4ecff 100644 --- a/helm/DEVEL/ocaml-http/http_misc.mli +++ b/helm/DEVEL/ocaml-http/http_misc.mli @@ -83,3 +83,6 @@ val buf_of_inchan: ?limit: int -> in_channel -> Buffer.t leftmost one only *) val list_assoc_all: 'a -> ('a * 'b) list -> 'b list +val warn: string -> unit (** print a warning msg to stderr. Adds trailing \n *) +val error: string -> unit (** print an error msg to stderr. Adds trailing \n *) +