OCaml: Add debug logging tests
This commit is contained in:
parent
fab9c7140d
commit
f3557d5bb4
5 changed files with 39 additions and 7 deletions
10
ocaml/lib/system/os.ml
Normal file
10
ocaml/lib/system/os.ml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
(* the side effect could be extracted to a log list in the schema *)
|
||||
let identify : string =
|
||||
let os_release = String.split_on_char '\n' (File.read "/etc/os-release") in
|
||||
Utilities.Log.elog (String.concat "\n" os_release);
|
||||
|
||||
let os_equals = List.find (String.starts_with ~prefix:"NAME=") os_release in
|
||||
match String.split_on_char '=' os_equals with
|
||||
| [ _; s ] ->
|
||||
String.trim @@ String.map (fun c -> if c = '"' then ' ' else c) s
|
||||
| _ -> "Unknown"
|
||||
Loading…
Add table
Add a link
Reference in a new issue