From: Stefano Zacchiroli Date: Sun, 7 Sep 2003 09:53:48 +0000 (+0000) Subject: use an integer debugging level instead of a boolean one X-Git-Tag: v0_0_1~17 X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=commitdiff_plain;h=851b86c88a136e04c6042b86687096eb9c7f3175 use an integer debugging level instead of a boolean one --- diff --git a/helm/hbugs/common/hbugs_messages.ml b/helm/hbugs/common/hbugs_messages.ml index b7e6f5ddc..b320501ba 100644 --- a/helm/hbugs/common/hbugs_messages.ml +++ b/helm/hbugs/common/hbugs_messages.ml @@ -33,7 +33,10 @@ open Pxp_dtd;; open Pxp_types;; open Pxp_yacc;; -let debug = true;; +let debug = 2;; (* 0 -> no debug + 1 -> waiting for an answer / answer received + 2 -> XML messages dumping + *) exception Attribute_not_found of string;; exception Empty_node;; (** found a node with no _element_ children *) @@ -333,7 +336,7 @@ let string_of_msg = function (* debugging function that dump on stderr the sent messages *) let dump_msg msg = - if debug then + if debug >= 2 then prerr_endline (sprintf "\n%s\n" (match msg with @@ -343,11 +346,11 @@ let dump_msg msg = let submit_req ~url msg = dump_msg msg; - if debug then (prerr_string "Waiting for an answer ... "; flush stderr); + if debug >= 1 then (prerr_string "Waiting for an answer ... "; flush stderr); let res = msg_of_string (Hbugs_misc.http_post ~body:(string_of_msg msg) url) in - if debug then (prerr_string "answer received!\n"; flush stderr); + if debug >= 1 then (prerr_string "answer received!\n"; flush stderr); res ;; let return_xml_msg body outchan =