Index: core/kernel/utility/debugger/debugger.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- core/kernel/utility/debugger/debugger.js (revision 15940) +++ core/kernel/utility/debugger/debugger.js (revision ) @@ -60,6 +60,7 @@ // Debugger function Debugger($params) { this.RowSeparator = ''; + this.FilterTypes = $params['FilterTypes']; this.IsFatalError = false; this.ErrorsCount = 0; this.SQLCount = 0; @@ -215,11 +216,21 @@ this.MakeDragable('debug_toolbar_span', function() {}, function() {}, function() {}); } -Debugger.prototype.AppendRow = function($html) { +Debugger.prototype.AppendRow = function($html, $row_type) { + $row_type = $row_type || 'other'; this.RowCount++; var $tr = document.createElement('TR'); this.DebuggerTable.appendChild($tr); $tr.className = 'debug_row_' + (this.RowCount % 2 ? 'odd' : 'even'); + + if ( this.RowCount > 2 ) { + $tr.setAttribute('data-row-type', $row_type); + + if ( $row_type == 'error' ) { + document.getElementById('debug_row_' + (this.RowCount -1 )).setAttribute('data-row-type', 'error'); + } + } + $tr.id = 'debug_row_' + this.RowCount; var $td = document.createElement('TD'); $td.className = 'debug_cell'; @@ -365,6 +376,22 @@ if ($e.stopPropagation) $e.stopPropagation(); } +Debugger.prototype.Filter = function() { + + var $new_filter = document.getElementById('dbg_filter').value; + var $container_class_name = 'debug_layer_container'; + + if ( $new_filter != '' ) { + for (var index = 0; index < this.FilterTypes.length; ++index) { + if ( this.FilterTypes[index] != $new_filter ) { + $container_class_name += ' dbg-' + this.FilterTypes[index] + '-row-hidden'; + } + } + } + + this.DebuggerDIV.className = $container_class_name; +} + Debugger.prototype.Toggle = function($KeyCode) { if(!this.DebuggerDIV) return false; this.IsVisible = this.DebuggerDIV.style.display == 'none' ? false : true; @@ -400,7 +427,8 @@ } for (var $i = 0; $i < contents.length - 1; $i++) { - p_object.AppendRow(contents[$i]); + $json = eval('(' + contents[$i] + ')'); + p_object.AppendRow($json['html'], $json['row_type']); } if ( p_object.jQueryFound() ) { \ No newline at end of file Index: core/kernel/utility/debugger/debugger.css IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- core/kernel/utility/debugger/debugger.css (revision 15940) +++ core/kernel/utility/debugger/debugger.css (revision ) @@ -132,4 +132,6 @@ padding: 0px; } - +.dbg-error-row-hidden tr[data-row-type="error"], .dbg-warning-row-hidden tr[data-row-type="warning"], +.dbg-notice-row-hidden tr[data-row-type="notice"], .dbg-sql-row-hidden tr[data-row-type="sql"], +.dbg-other-row-hidden tr[data-row-type="other"] {display: none} \ No newline at end of file Index: core/kernel/utility/debugger.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- core/kernel/utility/debugger.php (revision 15940) +++ core/kernel/utility/debugger.php (revision ) @@ -224,6 +224,8 @@ */ private $_lastErrorProcessed = false; + private $_filterTypes = Array ('error', 'warning', 'notice', 'sql', 'other'); + /** * Counts warnings on the page * @@ -1468,7 +1470,7 @@ $this->appendSession(); // show php session if any // ensure, that 1st line of debug output always is this one: - $top_line = '
[Reload Frame] [Hide Debugger] [Clear Debugger][Current Time: ' . date('H:i:s') . '] [File Size: #DBG_FILESIZE#]
'; + $top_line = '
[Reload Frame] [Hide Debugger] [Clear Debugger][Current Time: ' . date('H:i:s') . '] [File Size: #DBG_FILESIZE#]
' . $this->getFilterDropdown() . '
'; $this->appendHTML($top_line); $this->moveToBegin(1); @@ -1552,7 +1554,24 @@ $lineCount = count($this->Data); while ( $i < $lineCount ) { - fwrite($fp, $this->prepareHTML($i) . $this->rowSeparator); + $html = $this->prepareHTML($i); + $row_type = 'other'; + + if ( preg_match('#Query Number#', $html) || preg_match('#SQL Total time:#', $html) ) { + $row_type = 'sql'; + } + + if ( preg_match('#class="debug_error"#', $html) ) { + if ( preg_match('#class="debug_error">Notice#', $html) ) { + $row_type = 'notice'; + } elseif ( preg_match('#class="debug_error">Warning#', $html) ) { + $row_type = 'warning'; + } else { + $row_type = 'error'; + } + } + + fwrite($fp, json_encode(Array ('html' => $html, 'row_type' => $row_type)) . $this->rowSeparator); $i++; } @@ -1569,6 +1588,7 @@ $dbg_path = str_replace(FULL_PATH, '', $this->tempFolder); $debugger_params = Array ( + 'FilterTypes' => $this->_filterTypes, 'RowSeparator' => $this->rowSeparator, 'ErrorsCount' => (int)$this->getProfilerTotal('error_handling'), 'IsFatalError' => $this->IsFatalError, @@ -1632,6 +1652,17 @@ } return ''; + } + + function getFilterDropdown() + { + $filter_options = ''; + + foreach ( $this->_filterTypes as $filter_type ) { + $filter_options .= ''; + } + + return ' [Show: ]'; } function getMemoryUsed($debugger_start)