Skip to content

Commit

Permalink
Adding logging for process events and project add
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinepouille committed Jul 10, 2024
1 parent 0efdef0 commit 6808403
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gui/state_project.ml
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,11 @@ let init existing_projects : unit Lwt.t =
let projects = Common_state.url_args ~default:[ "default" ] "project" in
let rec add_projects projects : unit Lwt.t =
match projects with
| [] -> Lwt.return_unit
| [] ->
Common.log_group_end ();
Lwt.return_unit
| project :: projects ->
let () = Common.debug ~loc:__LOC__ ("add project `" ^ project ^ "`") in
add_project
(List.for_all (fun x -> x <> project) existing_projects)
project
Expand All @@ -559,6 +562,7 @@ let init existing_projects : unit Lwt.t =
in
add_projects projects)
in
let () = Common.log_group "[State_project.init] add projects" in
add_projects existing_projects >>= fun () -> add_projects projects

let eval_with_project :
Expand Down
6 changes: 6 additions & 0 deletions gui/viz/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ function spawnProcess(param){
const spawn = require('child_process').spawn;
const process = spawn(param.command, param.args, {shell: true});

process.on('spawn', () => {debug("[Process] SPAWNED", param.command)});
process.on('exit', () => {error("[Process] EXIT", param.command)});
process.on('error', () => {error("[Process] ERROR", param.command)});
process.on('close', () => {error("[Process] CLOSE", param.command)});
process.on('message', () => {debug("[Process] MESSAGE", param.command)});

function spawnFailure(param,message){
if(param.onError){
// pid is logged here
Expand Down

0 comments on commit 6808403

Please sign in to comment.