projects
/
SXSI
/
xpathcomp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change the structure of log messages. Add a new
[SXSI/xpathcomp.git]
/
src
/
main.ml
diff --git
a/src/main.ml
b/src/main.ml
index
00d5ab9
..
69bd091
100644
(file)
--- a/
src/main.ml
+++ b/
src/main.ml
@@
-24,7
+24,9
@@
let mk_runtime run auto doc arg count print outfile =
if !Config.do_perf then start_perf ();
let r = Utils.time ~count:!Config.repeat ~msg:"Execution time" (run auto doc) arg in
if !Config.do_perf then stop_perf ();
if !Config.do_perf then start_perf ();
let r = Utils.time ~count:!Config.repeat ~msg:"Execution time" (run auto doc) arg in
if !Config.do_perf then stop_perf ();
- Logger.verbose Format.err_formatter "Number of results: %i@\n" (count r);
+ Logger.start_msg Format.err_formatter "[Debug] Number of results: ";
+ Logger.msg Format.err_formatter "%i" (count r);
+ Logger.end_msg Format.err_formatter "\n";
match outfile with
None -> ()
| Some file ->
match outfile with
None -> ()
| Some file ->
@@
-37,12
+39,17
@@
let main v query_string output =
let query =
Utils.time ~msg:"Parsing query" XPath.parse query_string
in
let query =
Utils.time ~msg:"Parsing query" XPath.parse query_string
in
- Logger.verbose Format.err_formatter "Parsed query:%a@\n"
- XPath.Ast.print query;
+ Logger.start_msg Format.err_formatter "[Debug]";
+ Logger.msg Format.err_formatter " Parsed query: @\n @[<v 0> {";
+ Logger.msg Format.err_formatter " %a }@]" XPath.Ast.print query;
+ Logger.end_msg Format.err_formatter "\n\n";
let auto, bu_info =
Utils.time ~msg:"Compiling query" Compile.compile query
in
let auto, bu_info =
Utils.time ~msg:"Compiling query" Compile.compile query
in
- if !Config.verbose then Ata.print Format.err_formatter auto;
+ Logger.start_msg Format.err_formatter "[Debug] Automaton: ";
+ Logger.msg Format.err_formatter "@\n @[<v 0>";
+ Logger.msg Format.err_formatter "%a" Ata.print auto;
+ Logger.end_msg Format.err_formatter "\n\n";
Gc.full_major();
Gc.compact();
Gc.set (tuned_gc);
Gc.full_major();
Gc.compact();
Gc.set (tuned_gc);
@@
-88,7
+95,7
@@
let _ =
if Filename.check_suffix !Config.input_file ".srx"
then
Utils.time
if Filename.check_suffix !Config.input_file ".srx"
then
Utils.time
- ~msg:"Loading file"
+ ~msg:"Loading
Index
file"
(Tree.load
~sample:!Config.sample_factor
~load_text:(not !Config.disable_text_collection))
(Tree.load
~sample:!Config.sample_factor
~load_text:(not !Config.disable_text_collection))
@@
-96,7
+103,7
@@
let _ =
else
let v =
Utils.time
else
let v =
Utils.time
- ~msg:"
Parsing document
"
+ ~msg:"
Loading XML file
"
(Tree.parse_xml_uri)
!Config.input_file
in
(Tree.parse_xml_uri)
!Config.input_file
in
@@
-111,9
+118,11
@@
let _ =
v
in
main document !Config.query !Config.output_file;
v
in
main document !Config.query !Config.output_file;
- Logger.verbose Format.err_formatter "Maximum resident set size: %s @\n" (read_procmem());
- Gc.full_major();
+IFDEF PROFILE
+ THEN
Profile.summary Format.err_formatter
Profile.summary Format.err_formatter
+ ELSE ()
+END
with
| Ulexer.Loc.Exc_located ((x,y),e) ->
Logger.print Format.err_formatter "character %i-%i %s@\n" x y (Printexc.to_string e);
with
| Ulexer.Loc.Exc_located ((x,y),e) ->
Logger.print Format.err_formatter "character %i-%i %s@\n" x y (Printexc.to_string e);