From e1403f2a0c2d344acfb5608b14955285b2773dac Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Wed, 6 Jul 2016 14:18:41 -0700 Subject: [PATCH] Create log dir only if results_dir exists Summary: Create log dir only if results_dir exists, otherwise, log to standard output and error even in developer mode. Reviewed By: sblackshear Differential Revision: D3522737 fbshipit-source-id: e00571b --- infer/src/backend/logging.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/infer/src/backend/logging.ml b/infer/src/backend/logging.ml index 9a2eb7cbe..415237e67 100644 --- a/infer/src/backend/logging.ml +++ b/infer/src/backend/logging.ml @@ -86,7 +86,10 @@ let out_formatter, err_formatter = with Sys_error _ -> failwithf "@.ERROR: cannot open output file %s@." fname in - if Config.developer_mode then + if Config.developer_mode + && Sys.file_exists Config.results_dir + && Sys.is_directory Config.results_dir + then let log_dir_name = "log" in let analyzer_out_name = "analyzer_out" in let analyzer_err_name = "analyzer_err" in