diff --git a/infer/src/backend/infer.ml b/infer/src/backend/infer.ml index 8657786a5..3e97a333c 100644 --- a/infer/src/backend/infer.ml +++ b/infer/src/backend/infer.ml @@ -77,12 +77,16 @@ let log_environment_info () = let prepare_events_logging () = (* there's no point in logging data from the events command. To fetch them we'd need to run events again... *) if CLOpt.equal_command Config.command CLOpt.Events then () - else ( - L.environment_info "Infer log identifier is %s\n" (EventLogger.get_log_identifier ()) ; + else + let log_identifier_msg = + Printf.sprintf "Infer log identifier is %s\n" (EventLogger.get_log_identifier ()) + in + L.environment_info "%s" log_identifier_msg ; + if CLOpt.is_originator && Config.print_log_identifier then L.progress "%s" log_identifier_msg ; let log_uncaught_exn exn ~exitcode = EventLogger.log (EventLogger.UncaughtException (exn, exitcode)) in - L.set_log_uncaught_exception_callback log_uncaught_exn ) + L.set_log_uncaught_exception_callback log_uncaught_exn let () = @@ -145,4 +149,3 @@ let () = EventLogger.dump () ) ; (* to make sure the exitcode=0 case is logged, explicitly invoke exit *) L.exit 0 - diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 0d0a7b548..4513187be 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -1618,6 +1618,12 @@ and print_builtins = "Print the builtin functions and exit" +and print_log_identifier = + CLOpt.mk_bool ~long:"print-log-identifier" + ~in_help:CLOpt.([(Run, manual_generic)]) + "Print the unique identifier that is common to all logged events" + + and print_using_diff = CLOpt.mk_bool ~deprecated_no:["noprintdiff"] ~long:"print-using-diff" ~default:true "Highlight the difference w.r.t. the previous prop when printing symbolic execution debug info" @@ -2571,6 +2577,8 @@ and print_active_checkers = !print_active_checkers and print_builtins = !print_builtins +and print_log_identifier = !print_log_identifier + and print_logs = !print_logs and print_types = !print_types diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index cdaaea3bb..02f6ff713 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -564,6 +564,8 @@ val print_active_checkers : bool val print_builtins : bool +val print_log_identifier : bool + val print_logs : bool val print_types : bool