Fixed ticket 208, added more logging in GitServe and Scm backend.
This commit is contained in:
@@ -87,6 +87,42 @@ class IDF_Scm
|
||||
return call_user_func(array($scms[$scm], 'factory'), $project);
|
||||
}
|
||||
|
||||
/**
|
||||
* Run exec and log some information.
|
||||
*
|
||||
* @param $caller Calling method
|
||||
* @param $cmd Command to run
|
||||
* @param &$out Array of output
|
||||
* @param &$return Return value
|
||||
* @return string Last line of the command
|
||||
*/
|
||||
public static function exec($caller, $cmd, &$out=null, &$return=null)
|
||||
{
|
||||
Pluf_Log::stime('timer');
|
||||
$ret = exec($cmd, $out, $return);
|
||||
Pluf_Log::perf(array($caller, $cmd, Pluf_Log::etime('timer', 'total_exec')));
|
||||
Pluf_Log::debug(array($caller, $cmd, $out));
|
||||
Pluf_Log::inc('exec_calls');
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run shell_exec and log some information.
|
||||
*
|
||||
* @param $caller Calling method
|
||||
* @param $cmd Command to run
|
||||
* @return string The output
|
||||
*/
|
||||
public static function shell_exec($caller, $cmd)
|
||||
{
|
||||
Pluf_Log::stime('timer');
|
||||
$ret = shell_exec($cmd);
|
||||
Pluf_Log::perf(array($caller, $cmd, Pluf_Log::etime('timer', 'total_exec')));
|
||||
Pluf_Log::debug(array($caller, $cmd, $ret));
|
||||
Pluf_Log::inc('exec_calls');
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the size of the repository in bytes.
|
||||
*
|
||||
|
Reference in New Issue
Block a user