From: Stefano Zacchiroli Date: Wed, 11 Feb 2004 11:55:42 +0000 (+0000) Subject: added some debugging messages X-Git-Tag: V_0_3_0~27 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=90926d0f15211f458e3db188eb68fcb76c0bde46;p=helm.git added some debugging messages --- diff --git a/helm/ocaml/registry/helm_registry.ml b/helm/ocaml/registry/helm_registry.ml index 853163ea9..ec4182bca 100644 --- a/helm/ocaml/registry/helm_registry.ml +++ b/helm/ocaml/registry/helm_registry.ml @@ -25,6 +25,10 @@ open Printf +let debug = false +let debug_print s = + if debug then prerr_endline ("Helm_registry debugging: " ^ s) + exception Malformed_key of string exception Key_not_found of string exception Type_error of string * string * string (* expected type, value, msg *) @@ -75,6 +79,7 @@ let value_is_valid ~key ~value = (Hashtbl.find_all validators key) let set' registry ~key ~value = + debug_print (sprintf "Setting %s = %s" key value); key_is_valid key; value_is_valid ~key ~value; Hashtbl.replace registry key value @@ -127,6 +132,7 @@ let (get_string_list, set_string_list) = mk_get_set "string list" string_list_of_string string_of_string_list let save_to fname = + debug_print ("Saving configuration to " ^ fname); let oc = open_out fname in output_string oc "\n"; output_string oc "\n"; @@ -154,6 +160,7 @@ let load_from = let config = default_config in let entry = `Entry_document [ `Extend_dtd_fully; `Parse_xml_decl ] in fun fname -> + debug_print ("Loading configuration from " ^ fname); let document = parse_wfdocument_entity config (from_file fname) default_spec in