From dbbb01630190d999d3932fabd8a181b4f826f64f Mon Sep 17 00:00:00 2001 From: Son Ho Date: Fri, 7 Jan 2022 11:00:05 +0100 Subject: Improve logging and introduce eval_operands_prepare --- src/main.ml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main.ml') diff --git a/src/main.ml b/src/main.ml index e5c3c324..326ba08e 100644 --- a/src/main.ml +++ b/src/main.ml @@ -4,6 +4,7 @@ open Print module T = Types module A = CfimAst module I = Interpreter +module EL = Easy_logging.Logging (* This is necessary to have a backtrace when raising exceptions - for some * reason, the -g option doesn't work *) @@ -18,6 +19,7 @@ Usage: %s [OPTIONS] FILE Sys.argv.(0) let () = + (* Read the command line arguments *) let spec = [] in let spec = Arg.align spec in let filename = ref "" in @@ -38,6 +40,12 @@ let () = if !filename = "" then ( print_string usage; exit 1); + (* Set up the logging - for now we use default values - TODO: use the + * command-line arguments *) + statements_log#set_level EL.Debug; + expansion_log#set_level EL.Debug; + expressions_log#set_level EL.Warning; + (* Load the module *) let json = Yojson.Basic.from_file !filename in match cfim_module_of_json json with | Error s -> log#error "error: %s\n" s -- cgit v1.2.3