https://github.com/rareloop/lumberjack-debugbar
https://github.com/rareloop/lumberjack-debugbar
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rareloop/lumberjack-debugbar
- Owner: Rareloop
- License: mit
- Created: 2018-07-05T19:47:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-26T12:39:24.000Z (almost 7 years ago)
- Last Synced: 2024-04-26T06:21:24.021Z (almost 2 years ago)
- Language: PHP
- Size: 119 KB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Lumberjack Debug Bar
## Installation
```
composer require rareloop/lumberjack-debugbar
```
Once installed, register the Service Provider in config/app.php within your theme:
```php
'providers' => [
...
Rareloop\Lumberjack\DebugBar\DebugBarServiceProvider::class,
...
],
```
## Usage
The DebugBar will only register when the `app.debug` config setting is `true`, which means it should never show on production environments.
### Messages
In order to write to the Messages log you can use the `DebugBar` facade:
```php
use Rareloop\Lumberjack\DebugBar\Facades\DebugBar;
DebugBar::info('message');
DebugBar::warning(123);
DebugBar::error(['foo' => 'bar']);
```
### Timeline
In order to write to the Timeline log you can use the `DebugBar` facade:
```php
DebugBar::startMeasure('api-fetch', 'Time for API request');
DebugBar::stopMeasure('api-fetch');
DebugBar::addMeasure('now', microtime(true), microtime(true) + 10000);
DebugBar::measure('My long operation', function() {
// Do something…
});
```
### Logs
The logs tab will mirror anything that has been output to the Lumberjack logs.