]> matita.cs.unibo.it Git - helm.git/commitdiff
- MatitaLog output redirected to stderr for every message <> Message
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Mon, 25 Jul 2005 12:45:09 +0000 (12:45 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Mon, 25 Jul 2005 12:45:09 +0000 (12:45 +0000)
- matitadep gracefully recovers from the inclusion of a non-existent .ma file

helm/matita/matitaLog.ml
helm/matita/matitadep.ml

index 6ac82da58cd9b968b3eb0dcf5d7cc2dc0ac0a49f..8d9fbe958586f69bb01f9025961da080255d6c6a 100644 (file)
@@ -40,15 +40,15 @@ let red    = "\e[0;31m"
 let black  = "\e[0m"
 
 let default_callback tag s =
-  let prefix =
+  let prefix,ch =
     match tag with
-    | `Message -> green  ^ "Info:  "
-    | `Warning -> yellow ^ "Warn:  "
-    | `Error ->   red    ^ "Error: "
-    | `Debug ->   blue   ^ "Debug: "
+    | `Message -> green  ^ "Info:  ", stdout
+    | `Warning -> yellow ^ "Warn:  ", stderr
+    | `Error ->   red    ^ "Error: ", stderr
+    | `Debug ->   blue   ^ "Debug: ", stderr
   in
-  print_endline (prefix ^ black ^ s);
-  flush stdout
+  output_string ch (prefix ^ black ^ s ^ "\n");
+  flush ch
 
 let callback = ref default_callback
 
index 88cac82807ff10953bb6549372b70c5a49b94de2..e355ab59c9efeaff8ca90a642114104e0e25d64d 100644 (file)
@@ -95,7 +95,13 @@ let main () =
               (_, TA.Alias (_, TA.Ident_alias(_, uri)))) -> 
                 Hashtbl.add aliases file uri
           | TA.Executable (_, TA.Command (_, TA.Include (_, path))) ->
-              Hashtbl.add deps file (MatitaMisc.obj_file_of_script (find path))
+             (try
+               Hashtbl.add deps file (MatitaMisc.obj_file_of_script (find path))
+              with
+               Sys_error _ ->
+                MatitaLog.error
+                 ("In file " ^ file ^ " unable to include " ^ path)
+             )
           | _ -> ()
         with 
           CicNotationParser.Parse_error _ as exn ->