Skip to content

Commit

Permalink
AbstractProcess: Add more verbose logging
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrzarzycki21 committed Jun 27, 2023
1 parent 583bba5 commit 93e28de
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions haxe/champaign/sys/io/process/AbstractProcess.hx
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,35 @@ abstract class AbstractProcess {

}

#if verbose_process_logs trace( '[${_className}] start mutex acquire' ); #end
_mutex.acquire();

final cwd:String = Sys.getCwd();
if ( _workingDirectory != null ) Sys.setCwd( _workingDirectory );

if ( _workingDirectory != null )
{
#if verbose_process_logs trace( '[${_className}] start set workingDirectory to: ${this._workingDirectory}' ); #end
Sys.setCwd( _workingDirectory );
}

_process = new Process( _cmd, _args );
#if java
_pid = 0;
#else
_pid = Std.int( _process.getPid() );
#end

#if verbose_process_logs trace( '[${_className}] start add to running process ${this._pid}' ); #end
ProcessManager.runningProcesses.add( this );
_running = true;
if ( _workingDirectory != null ) Sys.setCwd( cwd );


if ( _workingDirectory != null )
{
#if verbose_process_logs trace( '[${_className}] start set cwd to: ${cwd}' ); #end
Sys.setCwd( cwd );
}

#if verbose_process_logs trace( '[${_className}] start mutex release' ); #end
_mutex.release();

#if verbose_process_logs trace( '[${_className}][Process:${_pid}:${_cmd}:${_args}] Started' ); #end
Expand Down

0 comments on commit 93e28de

Please sign in to comment.