]> matita.cs.unibo.it Git - helm.git/commitdiff
added warn and error for messaging
authorStefano Zacchiroli <zack@upsilon.cc>
Thu, 3 Feb 2005 22:18:26 +0000 (22:18 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Thu, 3 Feb 2005 22:18:26 +0000 (22:18 +0000)
helm/DEVEL/ocaml-http/http_misc.ml
helm/DEVEL/ocaml-http/http_misc.mli

index fcec70ca5f4016523fca8e8bf757aa4e4f045cee..c4c9cfea97b457322a45483e07fa38df6b4b42cd 100644 (file)
@@ -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)
+
index b5972f830b0c55021b02a0fee74f76ea84c08f00..914b4ecffc46adf1a622259a46a77dec3318e9ce 100644 (file)
@@ -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 *)
+