From 788f58d3cfcd2395663e232c974b9b133b30a99d Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Thu, 25 Aug 2022 15:13:42 +0200 Subject: [PATCH] minor: no console --- mirage/config.ml | 4 ++-- mirage/unikernel.ml | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/mirage/config.ml b/mirage/config.ml index 996af38..c61a972 100644 --- a/mirage/config.ml +++ b/mirage/config.ml @@ -15,11 +15,11 @@ let mirror = foreign "Unikernel.Make" ~keys:[ Key.v uri ] ~packages:[ package "paf" ~min:"0.0.9" ; package "paf-cohttp" ~min:"0.0.7" ] - (console @-> time @-> pclock @-> stackv4v6 @-> dns_client @-> paf @-> job) + (time @-> pclock @-> stackv4v6 @-> dns_client @-> paf @-> job) let paf time stackv4v6 = paf_conf () $ time $ tcpv4v6_of_stackv4v6 stackv4v6 let stackv4v6 = generic_stackv4v6 default_network let () = register "mirror" - [ mirror $ default_console $ default_time $ default_posix_clock $ stackv4v6 $ generic_dns_client stackv4v6 $ paf default_time stackv4v6 ] + [ mirror $ default_time $ default_posix_clock $ stackv4v6 $ generic_dns_client stackv4v6 $ paf default_time stackv4v6 ] diff --git a/mirage/unikernel.ml b/mirage/unikernel.ml index cc7cdae..3e3d6e5 100644 --- a/mirage/unikernel.ml +++ b/mirage/unikernel.ml @@ -8,7 +8,6 @@ end open Lwt.Infix module Make - (Console : Mirage_console.S) (Time : Mirage_time.S) (Pclock : Mirage_clock.PCLOCK) (Stack : Tcpip.Stack.V4V6) @@ -61,9 +60,7 @@ module Make | _ -> Lwt.return_none in Mimic.(fold Client.ipaddr Fun.[ req dns; req Client.domain_name ] ~k ctx) - let log console fmt = Fmt.kstr (Console.log console) fmt - - let start console _time _pclock stack dns _paf_cohttp = + let start _time _pclock stack dns _paf_cohttp = let uri = Uri.of_string (Key_gen.uri ()) in let ctx = Mimic.empty @@ -74,6 +71,6 @@ module Make |> with_stack stack (* stack *) |> with_dns dns (* dns *) in Client.get ~ctx uri >>= fun (_resp, body) -> - Cohttp_lwt.Body.to_string body >>= fun str -> - log console "%S\n%!" str + Cohttp_lwt.Body.to_string body >|= fun str -> + Logs.info (fun m -> m "%S\n%!" str) end