Skip to content

Commit fb914b0

Browse files
author
Pete Bishop
committed
Remove error log parsing for now
1 parent e7d32b2 commit fb914b0

File tree

1 file changed

+1
-39
lines changed

1 file changed

+1
-39
lines changed

src/Commands/DebugCommand.php

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public function handle(): void
3030
intro('Generating Debug Information...');
3131

3232
$this->processEnvironment()
33-
->processNativePHP()
34-
->processErrorLog();
33+
->processNativePHP();
3534

3635
switch ($this->argument('output')) {
3736
case 'File':
@@ -126,43 +125,6 @@ private function processNativePHP(): static
126125
return $this;
127126
}
128127

129-
private function processErrorLog(): void
130-
{
131-
info('Processing Error Log Data...');
132-
$errorLog = file_exists($logPath = storage_path('logs/laravel.log'))
133-
? file_get_contents($logPath)
134-
: 'No logs found.';
135-
136-
// Process each line as a single array element
137-
$errorLog = explode(PHP_EOL, $errorLog);
138-
$errorCount = 0;
139-
$errors = [];
140-
141-
$currentLine = '';
142-
foreach ($errorLog as $line) {
143-
if ($errorCount === 5) {
144-
break;
145-
}
146-
147-
// Check if string starts with date format Y-m-d H:i:s in square brackets
148-
if (preg_match('/^\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\]/', $line)) {
149-
if (! empty($currentLine)) {
150-
$errors[] = $currentLine;
151-
$currentLine = '';
152-
$errorCount++;
153-
}
154-
}
155-
156-
$currentLine .= $line.PHP_EOL;
157-
}
158-
159-
if (! empty($currentLine)) {
160-
$errors[] = $currentLine;
161-
}
162-
163-
$this->debugInfo->put('ErrorLog', $errors);
164-
}
165-
166128
protected function promptForMissingArgumentsUsing(): array
167129
{
168130
return [

0 commit comments

Comments
 (0)