From: Andrea Asperti Date: Tue, 31 May 2005 09:54:16 +0000 (+0000) Subject: added colors X-Git-Tag: PRE_INDEX_1~92 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=8afcedb6b71f75aac2662629e7f9171085f5e1c2;p=helm.git added colors --- diff --git a/helm/matita/matitaLog.ml b/helm/matita/matitaLog.ml index 0b55e8318..02afaf9db 100644 --- a/helm/matita/matitaLog.ml +++ b/helm/matita/matitaLog.ml @@ -28,15 +28,26 @@ open Printf type log_tag = [ `Debug | `Error | `Message | `Warning ] type log_callback = log_tag -> string -> unit +(* +colors=(black red green yellow blue magenta cyan gray white) +ccodes=(30 31 32 33 34 35 36 37 39) +*) + +let green = "" +let blue = "" +let yellow = "" +let red = "" +let black = "" + let default_callback tag s = let prefix = match tag with - | `Message -> "Info: " - | `Warning -> "Warning: " - | `Error -> "Error: " - | `Debug -> "Debug: " + | `Message -> green ^ "Info: " + | `Warning -> yellow ^ "Warn: " + | `Error -> red ^ "Error: " + | `Debug -> blue ^ "Debug: " in - print_endline (prefix ^ s); + print_endline (prefix ^ black ^ s); flush stdout let callback = ref default_callback