Add the --log-events flag to turn on events logging

Reviewed By: mbouaziz

Differential Revision: D6611878

fbshipit-source-id: 6137f77
master
Martino Luca 7 years ago committed by Facebook Github Bot
parent d8bd7b7deb
commit e950103428

@ -1426,6 +1426,12 @@ and join_cond =
|}
and log_events =
CLOpt.mk_bool ~long:"log-events"
~in_help:CLOpt.([(Run, manual_generic)])
"Turn on the feature that logs events in a machine-readable format"
and log_file =
CLOpt.mk_string ~deprecated:["out_file"; "-out-file"] ~long:"log-file" ~meta:"file"
~default:"logs" "Specify the file to use for logging"
@ -2521,6 +2527,8 @@ and load_average =
and load_analysis_results = !load_results
and log_events = !log_events
and log_file = !log_file
and makefile_cmdline = !makefile

@ -523,6 +523,8 @@ val liveness : bool
val load_analysis_results : string option
val log_events : bool
val log_file : string
val makefile_cmdline : string

@ -30,10 +30,11 @@ module IO = struct
let prepare () =
if Config.log_events then (
close () ;
let fname = events_dir ^/ (Unix.getpid () |> Pid.to_string) ^ log_file_extension in
let oc = Pervasives.open_out_gen [Open_append; Open_creat] 0o666 fname in
out_chan := Some oc
out_chan := Some oc )
let write fmt =

Loading…
Cancel
Save