Skip to content

Commit

Permalink
Enable logtrace for messages (barryvdh#1508)
Browse files Browse the repository at this point in the history
* Enable logtrace for messages

* Bump debugbar version

* Enable
  • Loading branch information
barryvdh authored Feb 10, 2024
1 parent 0f431c1 commit c7b315f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"require": {
"php": "^8.0",
"maximebf/debugbar": "^1.19",
"maximebf/debugbar": "^1.20",
"illuminate/routing": "^9|^10",
"illuminate/session": "^9|^10",
"illuminate/support": "^9|^10",
Expand Down
3 changes: 3 additions & 0 deletions config/debugbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@
'time' => [
'memory_usage' => false, // Calculated by subtracting memory start and end, it may be inaccurate
],
'messages' => [
'trace' => true, // Trace the origin of the debug message
],
'memory' => [
'reset_peak' => false, // run memory_reset_peak_usage before collecting
'with_baseline' => false, // Set boot memory usage as memory peak baseline
Expand Down
8 changes: 7 additions & 1 deletion src/LaravelDebugbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,13 @@ public function boot()
}

if ($this->shouldCollect('messages', true)) {
$this->addCollector(new MessagesCollector());
$trace = $this->app['config']->get('debugbar.options.messages.trace', true);
$messages = new MessagesCollector();
if ($trace) {
$messages->collectFileTrace(true);
}

$this->addCollector($messages);
}

if ($this->shouldCollect('time', true)) {
Expand Down

0 comments on commit c7b315f

Please sign in to comment.