Skip to content

Commit

Permalink
Exclude log files from CustomLogs module
Browse files Browse the repository at this point in the history
Custom/extra column headers just confuse things. Might be a new CustomLogs panel coming soon instead.
  • Loading branch information
adrianbj committed Jul 9, 2024
1 parent 3637c31 commit 40ef193
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion TracyDebugger.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static function getModuleInfo() {
'summary' => __('Tracy debugger from Nette with many PW specific custom tools.', __FILE__),
'author' => 'Adrian Jones',
'href' => 'https://processwire.com/talk/forum/58-tracy-debugger/',
'version' => '4.26.28',
'version' => '4.26.29',
'autoload' => 100000, // in PW 3.0.114+ higher numbers are loaded first - we want Tracy first
'singular' => true,
'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4',
Expand Down
9 changes: 9 additions & 0 deletions panels/ProcesswireLogsPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,17 @@ public function getTab() {
$cachedLogLinesData = $logLinesData;

$errorLogs = array('errors', 'exceptions', 'files-errors');

if($this->wire('modules')->isInstalled('CustomLogs')) {
$custom_logs = $this->wire('modules')->getModuleConfigData('CustomLogs');
}

foreach($logs as $log) {

if(isset($custom_logs) && array_key_exists($log['name'], $custom_logs['customLogsParsed'])) {
continue;
}

$lines = \TracyDebugger::tailCustom($this->wire('config')->paths->logs.$log['name'].'.txt', \TracyDebugger::getDataValue("numLogEntries"));
$lines = mb_convert_encoding($lines, 'UTF-8');
$lines = explode("\n", $lines);
Expand Down

0 comments on commit 40ef193

Please sign in to comment.