Skip to content

Commit f9c2595

Browse files
committed
do not log callstack in single steps
1 parent 97a61e6 commit f9c2595

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/Outputs/Log.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@ public function boot()
1616
public function output(Collection $detectedQueries, Response $response)
1717
{
1818
LaravelLog::info('Detected N+1 Query');
19+
1920
foreach ($detectedQueries as $detectedQuery) {
20-
LaravelLog::info('Model: '.$detectedQuery['model']);
21-
LaravelLog::info('Relation: '.$detectedQuery['relation']);
22-
LaravelLog::info('Num-Called: '.$detectedQuery['count']);
21+
$logOutput = 'Model: '.$detectedQuery['model'] . PHP_EOL;
22+
23+
$logOutput .= 'Relation: '.$detectedQuery['relation'] . PHP_EOL;
2324

24-
LaravelLog::info('Call-Stack:');
25+
$logOutput .= 'Num-Called: '.$detectedQuery['count'] . PHP_EOL;
26+
27+
$logOutput .= 'Call-Stack:' . PHP_EOL;
2528

2629
foreach ($detectedQuery['sources'] as $source) {
27-
LaravelLog::info('#'.$source->index.' '.$source->name.':'.$source->line);
30+
$logOutput .= '#'.$source->index.' '.$source->name.':'.$source->line . PHP_EOL;
2831
}
32+
33+
LaravelLog::info($logOutput);
2934
}
3035
}
3136
}

0 commit comments

Comments
 (0)