|
|
@@ -397,7 +397,7 @@ class Route_Debug extends RouteBase {
|
|
|
$logPath = "{$this->logPathPrefix}se-{$type}-{$logName}.log";
|
|
|
if (!file_exists($logPath)) throw new Exception("Log file not exists");
|
|
|
$content = file_get_contents($logPath);
|
|
|
- $lastTime = '';
|
|
|
+ $lastTime = '';
|
|
|
UI::table([
|
|
|
'cols' => [
|
|
|
'date',
|
|
|
@@ -420,11 +420,15 @@ class Route_Debug extends RouteBase {
|
|
|
'msg' => "Error Processing Request - Parse json error: " . json_last_error()
|
|
|
];
|
|
|
}
|
|
|
- $timeDiff = (!$lastTime)
|
|
|
- ? ''
|
|
|
- : V::milisecondsStringDiff($dbg['date'], $lastTime)
|
|
|
- ; // TODO: $dbg['date'] - $lastTime;
|
|
|
- $lastTime = $dbg['date'];
|
|
|
+ $timeDiff = (!$lastTime)
|
|
|
+ ? ''
|
|
|
+ : V::milisecondsStringDiff($dbg['date'], $lastTime); // TODO: $dbg['date'] - $lastTime;
|
|
|
+ $lastTime = $dbg['date'];
|
|
|
+ $trace = htmlspecialchars($dbg['trace']);
|
|
|
+ $trace = str_replace("\n", "\n<br>", $trace);
|
|
|
+ if ('#' === substr($trace, 0, 1)) $trace = "<br>{$trace}";
|
|
|
+ $trace = preg_replace('/<br>#(\d+\W+)([a-zA-Z0-9-_:\.\/]*):/', '#${1}<a href="http://localhost:9876/?project=se&file=${2}" target="_blank">${2}</a>:', $trace);
|
|
|
+ $trace = str_replace("\n<br>", "\n", $trace);
|
|
|
return [
|
|
|
'date' => '<nobr>' . $dbg['date'] . '</nobr>',
|
|
|
'diff' => '<nobr>' . $timeDiff . '</nobr>',
|
|
|
@@ -442,14 +446,18 @@ class Route_Debug extends RouteBase {
|
|
|
], str_replace(array('\n', '\t'), ' ', substr(htmlspecialchars(json_encode($dbg['log'])), 0, 100)) . ' ...')
|
|
|
]),
|
|
|
'trace' => UI::h('div', [], [
|
|
|
- UI::h('div', [
|
|
|
- 'title' => htmlspecialchars($dbg['trace']),
|
|
|
- 'onClick' => "return p5DBG__showLogTrace(this, event)",
|
|
|
- 'style' => "cursor:pointer"
|
|
|
- ], ('Exception' == $dbg['type'])
|
|
|
- ? "Code: {$dbg['log']['code']}, File: {$dbg['log']['file']}"
|
|
|
- : '...'
|
|
|
- )
|
|
|
+ UI::h('details', [], [
|
|
|
+ UI::h('summary', [], "trace: (rozwiń)"),
|
|
|
+ UI::h('pre', [ 'style' => "font-size:x-small" ], $trace),
|
|
|
+ UI::h('div', [
|
|
|
+ 'title' => htmlspecialchars($dbg['trace']),
|
|
|
+ 'onClick' => "return p5DBG__showLogTrace(this, event)",
|
|
|
+ 'style' => "cursor:pointer"
|
|
|
+ ], ('Exception' == $dbg['type'])
|
|
|
+ ? "Code: {$dbg['log']['code']}, File: {$dbg['log']['file']}"
|
|
|
+ : '...'
|
|
|
+ ),
|
|
|
+ ]),
|
|
|
]),
|
|
|
];
|
|
|
},
|