@ -16,8 +16,8 @@ module F = Format
(* * Name of dir for logging the output in the specific executable *)
(* * Name of dir for logging the output in the specific executable *)
let log_dir_of_current_exe =
let log_dir_of_current_exe (current_exe : CommandLineOption . exe ) =
match Config . current_exe with
match current_exe with
| Analyze -> " analyze "
| Analyze -> " analyze "
| BuckCompilationDatabase -> " buck_compilation_database "
| BuckCompilationDatabase -> " buck_compilation_database "
| Clang -> " clang "
| Clang -> " clang "
@ -35,9 +35,9 @@ let err_file = ref "<BUG: logging to a file not setup, what you're looking for w
let out_formatter = ref F . std_formatter
let out_formatter = ref F . std_formatter
let err_formatter = ref F . err_formatter
let err_formatter = ref F . err_formatter
let set_log_file_identifier string_opt =
let set_log_file_identifier ( current_exe : CommandLineOption . exe ) string_opt =
let should_setup_log_files =
let should_setup_log_files =
match Config . current_exe with
match current_exe with
| Analyze
| Analyze
| Clang -> Config . debug_mode | | Config . stats_mode
| Clang -> Config . debug_mode | | Config . stats_mode
| BuckCompilationDatabase -> true
| BuckCompilationDatabase -> true
@ -48,7 +48,7 @@ let set_log_file_identifier string_opt =
| None -> " " ) ^ string_of_int ( Unix . getpid () ) ^ " _ " in
| None -> " " ) ^ string_of_int ( Unix . getpid () ) ^ " _ " in
let exe_log_dir =
let exe_log_dir =
let log_dir = Config . results_dir // Config . log_dir_name in
let log_dir = Config . results_dir // Config . log_dir_name in
log_dir // log_dir_of_current_exe in
log_dir // ( log_dir_of_current_exe current_exe ) in
create_path exe_log_dir ;
create_path exe_log_dir ;
let log_file config_opt suffix =
let log_file config_opt suffix =
(* the command-line option takes precedence if specified *)
(* the command-line option takes precedence if specified *)
@ -77,7 +77,7 @@ let set_log_file_identifier string_opt =
)
)
(* set up log files on startup if needed *)
(* set up log files on startup if needed *)
let () = set_log_file_identifier None
let () = set_log_file_identifier Config . current_exe None
let log_file_names () = ( ! out_file , ! err_file )
let log_file_names () = ( ! out_file , ! err_file )