Skip to content
Snippets Groups Projects
Commit 02d7ebf7 authored by erwan's avatar erwan
Browse files

Chore: enhance sasa warning messages

parent de2afd46
No related branches found
No related tags found
No related merge requests found
...@@ -54,11 +54,11 @@ let (f: string list -> string * string -> unit) = ...@@ -54,11 +54,11 @@ let (f: string list -> string * string -> unit) =
state_module state_module state_module ; state_module state_module state_module ;
flush oc; flush oc;
close_out oc; close_out oc;
Printf.printf "The file %s has been generated\n" register_file; Printf.printf " [sasa] The file %s has been generated\n" register_file;
flush stdout flush stdout
); );
if Sys.file_exists state_file then ( if Sys.file_exists state_file then (
Printf.printf "Warning: %s already exist.\n" state_file Printf.printf " [sasa] Warning: %s already exist.\n" state_file
) else ( ) else (
let oc = open_out state_file in let oc = open_out state_file in
let entete = Mypervasives.entete2 "(*" "*)" SasaVersion.str SasaVersion.sha in let entete = Mypervasives.entete2 "(*" "*)" SasaVersion.str SasaVersion.sha in
...@@ -70,6 +70,6 @@ let copy x = x ...@@ -70,6 +70,6 @@ let copy x = x
"; ";
flush oc; flush oc;
close_out oc; close_out oc;
Printf.printf "The file %s has been generated\n" state_file; Printf.printf " [sasa] The file %s has been generated\n" state_file;
flush stdout flush stdout
) )
(* Time-stamp: <modified the 04/11/2019 (at 10:47) by Erwan Jahier> *) (* Time-stamp: <modified the 14/01/2020 (at 09:36) by Erwan Jahier> *)
type t = { type t = {
...@@ -100,7 +100,8 @@ let myexit i = exit i ...@@ -100,7 +100,8 @@ let myexit i = exit i
let seed_set args s = let seed_set args s =
(match s with (match s with
| Some i -> | Some i ->
Printf.fprintf stderr "The sasa random engine seed is set to %i\n" i; if args.verbose>0 then
Printf.fprintf stderr " [sasa] The sasa random engine seed is set to %i\n%!" i;
Random.init i; Random.init i;
flush stderr; flush stderr;
| None -> () | None -> ()
...@@ -117,11 +118,11 @@ let reset_the_seed_to_last args = ...@@ -117,11 +118,11 @@ let reset_the_seed_to_last args =
let ic = open_in f in let ic = open_in f in
let seed = int_of_string (input_line ic) in let seed = int_of_string (input_line ic) in
args.seed <- Some seed; args.seed <- Some seed;
Printf.eprintf "Replay the sasa run using the seed in %s\n" f; Printf.eprintf " [sasa] Replay the sasa run using the seed in %s\n" f;
flush stderr; flush stderr;
true true
with _ -> with _ ->
Printf.eprintf "W: cannot recover the seed in %s\n" f; Printf.eprintf " [sasa] W: cannot recover the seed in %s\n" f;
flush stderr; flush stderr;
false false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment