Load log into an string array

This commit is contained in:
Guillaume 2026-03-13 18:38:38 +01:00
parent 1fd977fede
commit e1cc1d3858
3 changed files with 11 additions and 2 deletions

10
bin/inspector.ml Normal file
View file

@ -0,0 +1,10 @@
let load_lines filename =
In_channel.with_open_text filename In_channel.input_lines |> Array.of_list
let () =
if Array.length Sys.argv < 2 then (
Printf.eprintf "Usage: %s <logfile>\n" (Filename.basename Sys.argv.(0));
exit 1);
let contents = load_lines Sys.argv.(1) in
Printf.printf "Loaded %d lines\n" (Array.length contents)