@@ -65,19 +65,20 @@ module Prefix = struct
65
65
|> Option. map ~f: (fun (res : prefix_rule * int ) -> (fst res).channel_name)
66
66
67
67
let print_prefix_routing rules =
68
+ let log = Devkit.Log. from " context" in
68
69
let show_match l = String. concat ~sep: " or " @@ List. map ~f: (fun s -> s ^ " *" ) l in
69
70
rules
70
71
|> List. iter ~f: (fun (rule : prefix_rule ) ->
71
72
begin
72
73
match rule.allow, rule.ignore with
73
- | None , None -> Stdio. printf " any"
74
- | None , Some [] -> Stdio. printf " any"
75
- | None , Some l -> Stdio. printf " not %s" (show_match l)
76
- | Some l , None -> Stdio. printf " %s" (show_match l)
77
- | Some l , Some [] -> Stdio. printf " %s" (show_match l)
78
- | Some l , Some i -> Stdio. printf " %s and not %s" (show_match l) (show_match i)
74
+ | None , None -> log#info " any"
75
+ | None , Some [] -> log#info " any"
76
+ | None , Some l -> log#info " not %s" (show_match l)
77
+ | Some l , None -> log#info " %s" (show_match l)
78
+ | Some l , Some [] -> log#info " %s" (show_match l)
79
+ | Some l , Some i -> log#info " %s and not %s" (show_match l) (show_match i)
79
80
end ;
80
- Stdio. printf " -> #%s\n %!" rule.channel_name)
81
+ log#info " -> #%s\n %!" rule.channel_name)
81
82
end
82
83
83
84
module Label = struct
@@ -100,17 +101,18 @@ module Label = struct
100
101
rules |> List. filter_map ~f: match_rule |> List. dedup_and_sort ~compare: String. compare
101
102
102
103
let print_label_routing rules =
104
+ let log = Devkit.Log. from " context" in
103
105
let show_match l = String. concat ~sep: " or " l in
104
106
rules
105
107
|> List. iter ~f: (fun (rule : label_rule ) ->
106
108
begin
107
109
match rule.allow, rule.ignore with
108
- | None , None -> Stdio. printf " any"
109
- | None , Some [] -> Stdio. printf " any"
110
- | None , Some l -> Stdio. printf " not %s" (show_match l)
111
- | Some l , None -> Stdio. printf " %s" (show_match l)
112
- | Some l , Some [] -> Stdio. printf " %s" (show_match l)
113
- | Some l , Some i -> Stdio. printf " %s and not %s" (show_match l) (show_match i)
110
+ | None , None -> log#info " any"
111
+ | None , Some [] -> log#info " any"
112
+ | None , Some l -> log#info " not %s" (show_match l)
113
+ | Some l , None -> log#info " %s" (show_match l)
114
+ | Some l , Some [] -> log#info " %s" (show_match l)
115
+ | Some l , Some i -> log#info " %s and not %s" (show_match l) (show_match i)
114
116
end ;
115
- Stdio. printf " -> #%s\n %!" rule.channel_name)
117
+ log#info " -> #%s\n %!" rule.channel_name)
116
118
end
0 commit comments