From 8afcedb6b71f75aac2662629e7f9171085f5e1c2 Mon Sep 17 00:00:00 2001 From: Andrea Asperti Date: Tue, 31 May 2005 09:54:16 +0000 Subject: [PATCH] added colors --- helm/matita/matitaLog.ml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) 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 -- 2.39.2