From 0f3c123a81b16e91cfe329e8f44aaffdccbc5662 Mon Sep 17 00:00:00 2001 From: Maxime Levillain Date: Tue, 3 Dec 2024 16:46:22 +0100 Subject: [PATCH] mask debugger for server --- src/server/ezAPIServerUtils.ml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/server/ezAPIServerUtils.ml b/src/server/ezAPIServerUtils.ml index 2798255..763a9ad 100644 --- a/src/server/ezAPIServerUtils.ml +++ b/src/server/ezAPIServerUtils.ml @@ -49,11 +49,16 @@ let pp_time () = GMTime.(date_of_tm @@ Unix.gmtime @@ time ()) let debug ?(v=0) fmt = - if !verbose > v then EzDebug.printf fmt + let mask_version = !verbose >= 8 in + if (not mask_version && !verbose > v) || + (mask_version && (v = 0 || ((!verbose/8) land v) <> 0)) then + EzDebug.printf fmt else Printf.ifprintf () fmt let debugf ?(v=0) f = - if !verbose > v then f () + let mask_version = !verbose >= 8 in + if (not mask_version && !verbose > v) || + (mask_version && ((!verbose/8) land v) <> 0) then f () (** Register Handler *)