File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11
2- open Printf
3-
42type level = [`Debug | `Info | `Warn | `Error | `Critical | `Nothing ]
53type facil = { name : string ; mutable show : int ; }
64let 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 }
You can’t perform that action at this time.
0 commit comments