Fix logging in run_external_command()
This commit is contained in:
parent
5dd35cabb2
commit
4bb16803bf
1 changed files with 10 additions and 4 deletions
|
@ -337,10 +337,16 @@ function delete_directory($dir, $recursive=true) {
|
||||||
|
|
||||||
$return_value = proc_close($process);
|
$return_value = proc_close($process);
|
||||||
|
|
||||||
if (!empty($stderr) || $return_value != 0)
|
$error = (!empty($stderr) || $return_value != 0);
|
||||||
logging('ERROR', "Externan command error:\nCommand : $command\nStdout :\n$stdout\n\n - Stderr :\n$stderr");
|
logging(
|
||||||
else
|
($error?'ERROR':'DEBUG'),
|
||||||
logging('DEBUG', "Externan command result:\n\tCommand : $command\n\tReturn code: $return_value\n\tOutput:\n\t\t- Stdout :\n$stdout\n\n\t\t- Stderr :\n$stderr");
|
"External command ".($error?"error":"result").":\n".
|
||||||
|
"\tCommand : $command\n".
|
||||||
|
"\tReturn code: $return_value\n".
|
||||||
|
"\tOutput:\n".
|
||||||
|
"\t\t- Stdout :\n$stdout\n\n".
|
||||||
|
"\t\t- Stderr :\n$stderr"
|
||||||
|
);
|
||||||
|
|
||||||
return array($return_value, $stdout, $stderr);
|
return array($return_value, $stdout, $stderr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue