Commit 1f0d6851 authored by Bruno Guillaume's avatar Bruno Guillaume
Browse files

Fix log detail

parent f1b674c4
......@@ -65,10 +65,16 @@ module Error = struct
let warning_ ?loc message =
match loc with
| Some loc -> ANSITerminal.eprintf [ANSITerminal.blue] "[%s] %s" (Loc.to_string loc) message
| None -> ANSITerminal.eprintf [ANSITerminal.blue] "%s" message
| Some loc -> ANSITerminal.eprintf [ANSITerminal.blue] "[%s] %s\n" (Loc.to_string loc) message
| None -> ANSITerminal.eprintf [ANSITerminal.blue] "%s\n" message
let warning ?loc = Printf.ksprintf (warning_ ?loc)
let info_ ?loc message =
match loc with
| Some loc -> ANSITerminal.eprintf [ANSITerminal.green] "[%s] %s\n" (Loc.to_string loc) message
| None -> ANSITerminal.eprintf [ANSITerminal.green] "%s\n" message
let info ?loc = Printf.ksprintf (info_ ?loc)
end (* module Error *)
(* ================================================================================ *)
......
......@@ -50,6 +50,8 @@ module Error: sig
val parse: ?loc: Loc.t -> ('a, unit, string, 'b) format4 -> 'a
val warning: ?loc: Loc.t -> ('a, unit, string, unit) format4 -> 'a
val info: ?loc: Loc.t -> ('a, unit, string, unit) format4 -> 'a
end
(* ================================================================================ *)
......
......@@ -471,7 +471,7 @@ module Corpus_desc = struct
) full_files
)
| Gr -> Error.run "Gr corpora are not supported in file compilation" in
let _ = Error.warning "[%s] %d graphs loaded" corpus_desc.id (Array.length items) in
let _ = Error.info "[%s] %d graphs loaded" corpus_desc.id (Array.length items) in
let out_ch = open_out_bin marshal_file in
let (data : Corpus.t) = {Corpus.items; kind=corpus_desc.kind } in
Marshal.to_channel out_ch data [];
......@@ -494,7 +494,7 @@ module Corpus_desc = struct
let marshal_time = (Unix.stat marshal_file).Unix.st_mtime in
if List.exists (fun f -> (Unix.stat f).Unix.st_mtime > marshal_time) full_files
then really_marshal () (* one of the data files is more recent than the marshal file *)
else Error.warning "--> %s is uptodate" corpus_desc.id
else Error.info "--> %s is uptodate" corpus_desc.id
with
| Unix.Unix_error _ ->
(* the marshal file does not exists *)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment