(** non thread safe, a processingLogger is usually instantied locally for each
thread *)
-class processingLogger =
- let html_escape s = (* TODO too naive, use Nethtml.encode instead *)
- Pcre.replace ~pat:"<" ~templ:"<"
- (Pcre.replace ~pat:">" ~templ:">"
- (Pcre.replace ~pat:"&" ~templ:"&" s))
- in
- fun () ->
+class processingLogger () =
object
val mutable log_lines: string list = []
method log msg = log_lines <- msg :: log_lines
"<html><body>\n%s\n</body></html>"
(String.concat
"<br />\n"
- (List.map html_escape (List.rev log_lines)))
+ (List.map (Netencoding.Url.encode ~plus:false) (List.rev log_lines)))
end