Skip to content

Commit d1e80c7

Browse files
author
Simon Cruanes
committed
remove Logger.put_limited, not used
1 parent ae85af0 commit d1e80c7

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

logger.ml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
open Printf
3-
42
type level = [`Debug | `Info | `Warn | `Error | `Critical | `Nothing]
53
type facil = { name : string; mutable show : int; }
64
let int_level = function
@@ -57,28 +55,3 @@ let put_simple (t:target) : t = {
5755
if allowed facil level then
5856
t.output level facil (t.format level facil ts pairs str)
5957
}
60-
61-
let put_limited (t:target) : t =
62-
let last = ref (`Debug,"") in
63-
let n = ref 0 in
64-
65-
(* FIXME not thread safe *)
66-
let put level facil ts pairs str =
67-
match allowed facil level with
68-
| false -> ()
69-
| true ->
70-
let this = (level,str) in
71-
if !last = this then
72-
incr n
73-
else
74-
begin
75-
if !n <> 0 then
76-
begin
77-
t.output level facil (sprintf
78-
"last message repeated %u times, suppressed\n" !n);
79-
n := 0
80-
end;
81-
last := this;
82-
t.output level facil (t.format level facil ts pairs str);
83-
end
84-
in { put }

0 commit comments

Comments
 (0)