summaryrefslogtreecommitdiff
path: root/src/main.ml
diff options
context:
space:
mode:
authorSon Ho2022-01-07 11:00:05 +0100
committerSon Ho2022-01-07 11:00:05 +0100
commitdbbb01630190d999d3932fabd8a181b4f826f64f (patch)
tree0011dda53aaeb88919b3354a9be5b21dca2aa45a /src/main.ml
parenta310c6036568d8f62e09804c67064686d106afd4 (diff)
Improve logging and introduce eval_operands_prepare
Diffstat (limited to '')
-rw-r--r--src/main.ml8
1 files changed, 8 insertions, 0 deletions
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