From 561564ceeafcf3e9d05274e26d8008d78ab3038a Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Mon, 26 Sep 2022 20:04:15 +0200 Subject: [PATCH] Adapt to Mirage 4.3.0 changes --- mirage-monitoring.opam | 2 +- src/mirage_monitoring.ml | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/mirage-monitoring.opam b/mirage-monitoring.opam index 2653c47..fd4811b 100644 --- a/mirage-monitoring.opam +++ b/mirage-monitoring.opam @@ -17,7 +17,7 @@ depends: [ "mirage-time" {>= "2.0.0"} "tcpip" {>= "7.0.0"} "mirage-solo5" {>= "0.9.0"} - "mirage-runtime" + "mirage-runtime" {>= "4.3.0"} "memtrace-mirage" {>= "0.2.1.2.2"} "mirage-clock" {>= "4.0.0"} ] diff --git a/src/mirage_monitoring.ml b/src/mirage_monitoring.ml index 3f4e450..b030e03 100644 --- a/src/mirage_monitoring.ml +++ b/src/mirage_monitoring.ml @@ -109,9 +109,7 @@ let get_metrics s = let adjust_log_level s = let ts = List.map - (fun s -> - try (fst Mirage_runtime.Arg.log_threshold) s with - Failure err -> `Error ("failure with " ^ s ^ ": " ^ err)) + (fun s -> (fst Mirage_runtime.Arg.log_threshold) s) (String.split_on_char ',' s) in let* oks = @@ -122,9 +120,7 @@ let adjust_log_level s = | `Error msg -> Error msg) (Ok []) ts in - Mirage_runtime.set_level - ~default:(Option.value (Logs.level ()) ~default:Logs.Info) - oks; + Mirage_runtime.set_level ~default:(Logs.level ()) oks; Ok `Empty let enable_of_str s =