Skip to content

Commit

Permalink
feat: prune livereload log to 1 day
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardBaumrock committed Mar 31, 2023
1 parent d9725d8 commit e8ea6b6
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions LiveReload.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,27 @@ public function __construct()
// user defined includes
'include' => [],
'excludeDefaults' => [
$this->wire->config->paths->templates . 'uikit-*',
$this->wire->config->paths->assets . 'backups',
$this->wire->config->paths->assets . 'cache',
$this->wire->config->paths->assets . 'files',
$this->wire->config->paths->assets . 'logs',
$this->wire->config->paths->assets . 'sessions',
$this->wire->config->paths->assets . 'ProCache-*',
$this->wire->config->paths->assets . 'pwpc',
'.*/vendor',
'.*/\.git',
'.*/\.github',
'.*/\.vscode',
'.*/site/modules/TracyDebugger/tracy-.*',
'.*/site/templates/bundle/*',

'.*/site/assets/backups',
'.*/site/assets/cache',
'.*/site/assets/files',
'.*/site/assets/logs',
'.*/site/assets/sessions',
'.*/site/assets/ProCache-*',
'.*/site/assets/pwpc',
'.*/site/assets/RockFrontend/.*.css',
'.*/site/assets/RockPdfDumps/*',

'.*/site/modules/TracyDebugger/tracy-.*',
'.*/site/modules/RockBlocks/blocks/.*.css',

'.*/site/templates/bundle/*',
'.*/site/templates/uikit',
'.*/site/templates/uikit-*',
],
// user defined exclude regexes
'exclude' => [],
Expand Down Expand Up @@ -178,6 +182,7 @@ public function watch()
$this->sse($file = $this->findModifiedFile($start));
if ($file) {
ob_end_flush();
$this->wire->log->prune('livereload', 1);
return $this->wire->log->save('livereload', $file);
}
while (ob_get_level() > 0) ob_end_flush();
Expand All @@ -189,8 +194,6 @@ public function watch()

public function __debuginfo()
{
return array_merge($this->config->getArray(), [
'getIncludes()' => $this->getIncludes(),
]);
return $this->config->getArray();
}
}

0 comments on commit e8ea6b6

Please sign in to comment.