From a4111d1db614ce04dce3f0b242939c3fc05e7ce5 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Thu, 3 Feb 2005 22:18:26 +0000 Subject: [PATCH] added warn and error for messaging --- helm/DEVEL/ocaml-http/http_misc.ml | 7 ++++++- helm/DEVEL/ocaml-http/http_misc.mli | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) 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 *) + -- 2.39.2