Skip to content

Commit

Permalink
mask debugger for server
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtori committed Dec 3, 2024
1 parent ce17643 commit 0f3c123
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/server/ezAPIServerUtils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 *)

Expand Down

0 comments on commit 0f3c123

Please sign in to comment.