Merge pull request 'Adapt to Mirage 4.3.0 changes' (#1) from mirage-4.3.0 into main

Reviewed-on: https://git.robur.io/robur/mirage-monitoring/pulls/1
This commit is contained in:
Reynir Björnsson 2022-09-26 18:53:51 +00:00
commit 36efee2f99
2 changed files with 3 additions and 7 deletions

View file

@ -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"}
]

View file

@ -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 =