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);
|
||||
|
||||
if (!empty($stderr) || $return_value != 0)
|
||||
logging('ERROR', "Externan command error:\nCommand : $command\nStdout :\n$stdout\n\n - Stderr :\n$stderr");
|
||||
else
|
||||
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");
|
||||
$error = (!empty($stderr) || $return_value != 0);
|
||||
logging(
|
||||
($error?'ERROR':'DEBUG'),
|
||||
"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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue