From cf0fffed43d0ca7618cd0013411151e057b7a32a Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Mon, 18 May 2026 12:35:26 -0300 Subject: RNT interface Co-authored-by: Estevan Castilho --- lib/utilities.ml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/utilities.ml') diff --git a/lib/utilities.ml b/lib/utilities.ml index 34b0eb1..7b77da9 100644 --- a/lib/utilities.ml +++ b/lib/utilities.ml @@ -3,8 +3,22 @@ module StringSet = Set.Make (String) module Result = struct let ( let* ) = Result.bind + let fmap f m = Result.bind m f end module Option = struct let ( let* ) = Option.bind end + +let print_with_time str = + let now = Unix.gettimeofday () in + let tm = Unix.localtime now in + let orange = "\027[38;5;208m" in + let reset = "\027[0m" in + let formatted_time = + Printf.sprintf "%04d-%02d-%02d %02d:%02d:%02d" (tm.Unix.tm_year + 1900) + (tm.Unix.tm_mon + 1) tm.Unix.tm_mday tm.Unix.tm_hour tm.Unix.tm_min + tm.Unix.tm_sec + in + print_endline + @@ Printf.sprintf "%s[%s]%s %s" orange formatted_time reset str -- cgit v1.2.3