From 954bacdd1f1ea6a649f3bf6cd5fab4d1222f9f8f Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Thu, 15 Apr 2004 13:35:00 +0000 Subject: [PATCH] - better pretty printing on /update - added stdout logger --- helm/ocaml/getter/http_getter.ml | 14 ++++++++------ helm/ocaml/getter/http_getter.mli | 4 ++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/helm/ocaml/getter/http_getter.ml b/helm/ocaml/getter/http_getter.ml index 807eecb52..1e85f70b4 100644 --- a/helm/ocaml/getter/http_getter.ml +++ b/helm/ocaml/getter/http_getter.ml @@ -45,6 +45,8 @@ type resolve_result = type logger_callback = HelmLogger.html_tag -> unit +let stdout_logger tag = print_string (HelmLogger.string_of_html_tag tag) + let not_implemented s = raise (Not_implemented ("Http_getter." ^ s)) let (index_line_sep_RE, index_sep_RE, trailing_types_RE, @@ -109,8 +111,8 @@ let update_from_server logger server_url = (* use global maps *) debug_print (sprintf "Warning: useless server %s" server_url); (match xml_index with | Some xml_index -> - logger (`T "Updating XML db ..."); - logger `BR; + logger (`T "- Updating XML db ..."); +(* logger `BR; *) List.iter (function | l when is_blank_line l -> () (* skip blank and commented lines *) @@ -137,8 +139,8 @@ let update_from_server logger server_url = (* use global maps *) | None -> ()); (match rdf_index with | Some rdf_index -> - logger (`T "Updating RDF db ..."); - logger `BR; + logger (`T "- Updating RDF db ..."); +(* logger `BR; *) List.iter (fun l -> try @@ -161,8 +163,8 @@ let update_from_server logger server_url = (* use global maps *) | None -> ()); (match xsl_index with | Some xsl_index -> - logger (`T "Updating XSLT db ..."); - logger `BR; + logger (`T "- Updating XSLT db ..."); +(* logger `BR; *) List.iter (fun l -> (Lazy.force xsl_map) # replace l (server_url ^ "/" ^ l)) (Pcre.split ~rex:index_sep_RE xsl_index); diff --git a/helm/ocaml/getter/http_getter.mli b/helm/ocaml/getter/http_getter.mli index 8d1ae4b5c..a7d12f5a1 100644 --- a/helm/ocaml/getter/http_getter.mli +++ b/helm/ocaml/getter/http_getter.mli @@ -28,8 +28,12 @@ open Http_getter_types + (** {2 Loggers} *) + type logger_callback = HelmLogger.html_tag -> unit +val stdout_logger: logger_callback + (** {2 Getter Web Service interface as API *) val help: unit -> string -- 2.39.2