3 final class DarkConsoleErrorLogPlugin
extends DarkConsolePlugin
{
5 public function getName() {
6 $count = count($this->getData());
8 return pht('Error Log (%d)', $count);
10 return pht('Error Log');
13 public function getOrder() {
17 public function getColor() {
18 if (count($this->getData())) {
24 public function getDescription() {
25 return pht('Shows errors and warnings.');
28 public function generateData() {
29 return DarkConsoleErrorLogPluginAPI
::getErrors();
32 public function renderPanel() {
33 $data = $this->getData();
38 foreach ($data as $index => $row) {
45 'sigil' => 'darkconsole-expand',
47 'expandID' => 'row-details-'.$index,
50 $row['str'].' at ['.basename($file).':'.$line.']');
51 $rows[] = array($tag);
53 $details[] = hsprintf(
54 '<div class="dark-console-panel-error-details" id="row-details-%s">'.
59 foreach ($row['trace'] as $key => $entry) {
61 if (isset($entry['class'])) {
62 $line .= $entry['class'].'::';
64 $line .= idx($entry, 'function', '');
66 if (isset($entry['file'])) {
67 $line .= ' called at ['.$entry['file'].':'.$entry['line'].']';
74 $details[] = hsprintf('</div>');
77 $table = new AphrontTableView($rows);
78 $table->setClassName('error-log');
79 $table->setHeaders(array(pht('Error')));
80 $table->setNoDataString(pht('No errors.'));
86 phutil_tag('div', array(), $table->render()),
87 phutil_tag('pre', array('class' => 'PhabricatorMonospaced'), $details),