@@ -22,7 +22,7 @@ open Lwt.Syntax
2222open Js_of_ocaml
2323open Eliom_lib
2424
25- let section = Lwt_log.Section. make " eliom:dom"
25+ let section = Logs.Src. create " eliom:dom"
2626
2727let iter_nodeList nodeList f =
2828 for i = 0 to nodeList##.length - 1 do
@@ -420,14 +420,20 @@ let html_document (src : Dom.element Dom.document Js.t) registered_process_node
420420 | Some e -> (
421421 try Dom_html. document##(adoptNode (e :> Dom.element Js.t ))
422422 with exn -> (
423- Lwt_log. ign_debug ~section ~exn " can't adopt node, import instead" ;
423+ Logs. debug ~src: section (fun fmt ->
424+ fmt
425+ (" can't adopt node, import instead" ^^ " @\n %s" )
426+ (Printexc. to_string exn ));
424427 try Dom_html. document##(importNode (e :> Dom.element Js.t ) Js. _true)
425428 with exn ->
426- Lwt_log. ign_debug ~section ~exn " can't import node, copy instead" ;
429+ Logs. debug ~src: section (fun fmt ->
430+ fmt
431+ (" can't import node, copy instead" ^^ " @\n %s" )
432+ (Printexc. to_string exn ));
427433 copy_element content registered_process_node))
428434 | None ->
429- Lwt_log. ign_debug ~ section
430- " can't adopt node, document not parsed as html. copy instead" ;
435+ Logs. debug ~src: section ( fun fmt ->
436+ fmt " can't adopt node, document not parsed as html. copy instead" ) ;
431437 copy_element content registered_process_node
432438
433439(* * CSS preloading. *)
@@ -627,7 +633,10 @@ and rewrite_css_import ?(charset = "") ~max ~prefix ~media css pos =
627633 with
628634 | Incorrect_url -> Lwt. return ([] , rewrite_css_url ~prefix css pos)
629635 | exn ->
630- Lwt_log. ign_info ~section ~exn " Error while importing css" ;
636+ Logs. info ~src: section (fun fmt ->
637+ fmt
638+ (" Error while importing css" ^^ " @\n %s" )
639+ (Printexc. to_string exn ));
631640 Lwt. return ([] , rewrite_css_url ~prefix css pos))
632641
633642let max_preload_depth = ref 4
@@ -666,9 +675,11 @@ let preload_css (doc : Dom_html.element Js.t) =
666675 (fun (e , css ) ->
667676 try Dom. replaceChild (get_head doc) css e
668677 with _ ->
669- (* Node was a unique node that has been removed...
678+ Logs. info
679+ ~src:
680+ (* Node was a unique node that has been removed...
670681 in a perfect settings we won't have parsed it... *)
671- Lwt_log. ign_info ~ section " Unique CSS skipped..." )
682+ section ( fun fmt -> fmt " Unique CSS skipped..." ) )
672683 css;
673684 if ! Eliom_config. debug_timings
674685 then Console. console##(timeEnd (Js. string " preload_css (fetch+rewrite)" ));
0 commit comments