diff --git a/includes/functions.php b/includes/functions.php index 2176337..75ae196 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -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); }