diff --git a/constants.php b/constants.php index 871e258a5a11b776111fe46f2c56f31bcf9c3366..ce4b631aed92a208f9ee7e024f1a633d45b7eafe 100644 --- a/constants.php +++ b/constants.php @@ -6,8 +6,8 @@ $versionString = '2.9.1'; $rootDirNameToUseString = 'work'; -$isDebug = false; //logs debug to STDOUT -$debugOutputAllReturnOutput = false; //if true && $isDebug every response is also written to STDOUT +$isDebug = true; //logs debug (only if next line is true too) +$debugOutputAllReturnOutput = false; //if true && $isDebug every response is also written to a file $s_testServerCode = 'testServerCode'; # the test server code for one test $s_testServerMessage = 'testServerMessage'; # the test server message for one test @@ -176,10 +176,6 @@ function output($responseCode, $message, $data = null) global $s_timings_string_separator; global $debugTimings; - if ($isDebug && $debugOutputAllReturnOutput) { - fwrite(STDOUT, $message); - } - $responseObj = array( 'responseCode' => $responseCode, 'message' => $message, @@ -189,6 +185,12 @@ function output($responseCode, $message, $data = null) $responseString = json_encode($responseObj); + # make sure the file exist and is write/readable! + if ($isDebug && $debugOutputAllReturnOutput) { + #fwrite(STDOUT, $message); + file_put_contents('debugLogging.log', $responseString, FILE_APPEND); + } + echo $responseString; }