diff --git a/constants.php b/constants.php index 9d1762c6524c96b1fdd3e2f3d4499e3e312b2376..925ef6984f16d89a38e816a8e9e46c8389e472d1 100644 --- a/constants.php +++ b/constants.php @@ -3,7 +3,7 @@ # variables //use this to know which version we published -$versionString = '2.6.3'; +$versionString = '2.7.0'; $rootDirNameToUseString = 'work'; $isDebug = false; //logs debug to STDOUT @@ -63,6 +63,8 @@ $regexMathAllFilesAttribute = '*'; $responseNewLineString = '\r\n'; //to match interface $runnerNewLineString = "\\r\\n"; //starting with runner version 2.4 +$runnerDebugLogNewLineString = "\\n"; + # known error codes $status_code_Ok = 0; @@ -151,6 +153,7 @@ $s_timeForUserProgram = 'timeForUserProgram'; $s_output_without_header_part = 'stripedOutput'; $s_characterLimitExceeded = 'characterLimitExceeded'; $s_characterLimitUsed = 'characterLimitUsed'; +$s_headerKeyCharacterRunnerDebugLog = 'runnerDebugLog'; $s_header_part_separator = "---\\r\\n"; diff --git a/protocolHeaderPartParser.php b/protocolHeaderPartParser.php index 1ff7dc37429d41aa61863da6e7dc3b995888ffa8..078893317062088de6b0aca53f81c173a80faed3 100644 --- a/protocolHeaderPartParser.php +++ b/protocolHeaderPartParser.php @@ -11,6 +11,9 @@ function parseHeaderPart($output) global $s_output_without_header_part; global $s_characterLimitExceeded; global $runnerNewLineString; + global $s_headerKeyCharacterRunnerDebugLog; + + global $s_timings_string_separator; //if we have no header tuples we might have only so ---\n @@ -24,6 +27,7 @@ function parseHeaderPart($output) $timeForCompiling = NULL; $timeForUserProgram = NULL; $characterLimitExceeded = FALSE; + $runnerDebugLogLines = []; $headerPartLines = explode($runnerNewLineString, $headerPartText); @@ -67,7 +71,25 @@ function parseHeaderPart($output) $characterLimitExceeded = strtolower($val) === 'true'; + } else if (strpos($line, $s_headerKeyCharacterRunnerDebugLog) === 0) { + + $val = substr($line, strlen($s_headerKeyCharacterRunnerDebugLog)+1); + if ($val === null) continue; + + + if (!empty($val)) { + $runnerDebugLogLines = explode($s_timings_string_separator, $val); + addToDebugTimings("--start runner debug lines"); + #aadd the runner debug lines to the timings log + foreach ($runnerDebugLogLines as $runnerLogLine) { + addToDebugTimings($runnerLogLine); + } + addToDebugTimings("--finish runner debug lines"); + } + } + + }