Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: eec8274059
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (29 sloc) 0.789 kB
open Common
module J = Json_type
(* see opa/pfff_logger.opa *)
let log config cmd extra_args =
config +> do_option (fun server ->
let unixname = unixname() in
let extra_args =
match extra_args with
| Some s -> s
| None -> ""
in
let json = J.Object [
("unixname", J.String unixname);
("extra_args", J.String extra_args);
]
in
let str = Json_out.string_of_json json in
let tmpfile = Common.new_temp_file "logger" "json" in
Common.write_file tmpfile str;
let cmd =
spf "curl http://%s/_rest_/%s/ --data @%s 2>/dev/null 1>/dev/null"
server cmd tmpfile in
profile_code "pfff_logger" (fun () ->
try
timeout_function 1 (fun () ->
command2 cmd
) with Timeout -> ()
)
)
Jump to Line
Something went wrong with that request. Please try again.