X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fregistry%2Fhelm_registry.ml;h=ec4182bcaa967c664615bfc10c0cbf709f198900;hb=a549d5de0305140108e631654af621da1a3637c4;hp=853163ea91a90fd060149b65df91238774dc2692;hpb=958c4635b38a209392ee7d7fc3d2e07ed3d7e5d3;p=helm.git 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