diff options
| author | Pierre-Marie Pédrot | 2014-11-15 18:46:17 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2014-11-15 18:46:17 +0100 |
| commit | 8a03208daca697ec9c2414d0cf5231150ea539e5 (patch) | |
| tree | 5d53373cf76f58379595b428008eb3cf35c06d5a /lib/pp.ml | |
| parent | f3e126bc3e8b12bb9e9d2cd62b9de0dd818c85ef (diff) | |
Removing deprecated code handling color in Pp.
Diffstat (limited to 'lib/pp.ml')
| -rw-r--r-- | lib/pp.ml | 24 |
1 files changed, 9 insertions, 15 deletions
@@ -428,25 +428,19 @@ let is_message = Feedback.is_message type logger = message_level -> std_ppcmds -> unit -let print_color s x = x -(* FIXME *) -(* if Flags.is_term_color () then *) -(* (str ("\027[" ^ s ^ "m")) ++ x ++ (str "\027[0m") *) -(* else x *) +let make_body info s = + emacs_quote (hov 0 (info ++ spc () ++ s)) -let make_body color info s = - emacs_quote (print_color color (print_color "1" (hov 0 (info ++ spc () ++ s)))) - -let debugbody strm = print_color "36" (hov 0 (str "Debug:" ++ spc () ++ strm)) (* cyan *) -let warnbody strm = make_body "93" (str "Warning:") strm (* bright yellow *) -let errorbody strm = make_body "31" (str "Error:") strm (* bright red *) +let debugbody strm = hov 0 (str "Debug:" ++ spc () ++ strm) +let warnbody strm = make_body (str "Warning:") strm +let errorbody strm = make_body (str "Error:") strm let std_logger ~id:_ level msg = match level with -| Debug _ -> msgnl (debugbody msg) (* cyan *) -| Info -> msgnl (print_color "37" (hov 0 msg)) (* gray *) +| Debug _ -> msgnl (debugbody msg) +| Info -> msgnl (hov 0 msg) | Notice -> msgnl msg -| Warning -> Flags.if_warn (fun () -> msgnl_with !err_ft (warnbody msg)) () (* bright yellow *) -| Error -> msgnl_with !err_ft (errorbody msg) (* bright red *) +| Warning -> Flags.if_warn (fun () -> msgnl_with !err_ft (warnbody msg)) () +| Error -> msgnl_with !err_ft (errorbody msg) let logger = ref std_logger |
