X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fhbugs%2Fcommon%2Fhbugs_messages.ml;h=b320501ba70eb4b570a9ffae0f74d517c3425fdf;hb=851b86c88a136e04c6042b86687096eb9c7f3175;hp=b7e6f5ddc59a5cd7bdbed32c0d91df5fbe668b17;hpb=e636941304a5567a90e0d271e25325c0c8b5fce1;p=helm.git 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 =