Skip to content

Commit 95db547

Browse files
Inject DebugLoggerInterface rather than just DebugLogger
1 parent d56a062 commit 95db547

File tree

1 file changed

+4
-4
lines changed
  • pages/05.troubleshooting/01.debugging

1 file changed

+4
-4
lines changed

pages/05.troubleshooting/01.debugging/docs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,20 +212,20 @@ The level of detail can be specified with the `mail.smtp_debug` configuration va
212212
213213
#### Debug statements
214214
215-
We can also arbitrarily send manual debugging messages to `app/logs/userfrosting.log`. This is useful when you want to inspect the value of a server-side variable at a particular point in your code ("dumping the variable") or determine if a particular method or function is being called. To do this, simply use the `DebugLogger` :
215+
We can also arbitrarily send manual debugging messages to `app/logs/userfrosting.log`. This is useful when you want to inspect the value of a server-side variable at a particular point in your code ("dumping the variable") or determine if a particular method or function is being called. To do this, simply inject a `DebugLoggerInterface` :
216216
217217
```php
218-
// Inject `\UserFrosting\Sprinkle\Core\Log\DebugLogger` with attributes, or through constructor
218+
// Inject `\UserFrosting\Sprinkle\Core\Log\DebugLoggerInterface` with attributes, or through constructor
219219
#[\DI\Attribute\Inject]
220-
protected DebugLogger $logger;
220+
protected DebugLoggerInterface $logger;
221221
222222
// ...
223223
224224
$this->logger->debug("Fetching owls from database...");
225225
$this->logger->debug("Owls found:", $owls);
226226
```
227227
228-
[notice]`DebugLogger` is a wrapper for a [Monolog](https://github.com/Seldaek/monolog) logger instance, whose `debug` method takes a string as the first parameter and an optional array as a second parameter, and writes them to a log file. Monolog also supports more advanced logging capabilities - check their documentation for more details.[/notice]
228+
[notice]`DebugLoggerInterface` represents `\UserFrosting\Sprinkle\Core\Log\DebugLogger`, a wrapper for a [Monolog](https://github.com/Seldaek/monolog) logger instance, whose `debug` method takes a string as the first parameter and an optional array as a second parameter, and writes them to a log file. Monolog also supports more advanced logging capabilities - check their documentation for more details.[/notice]
229229
230230
#### Native PHP logging
231231

0 commit comments

Comments
 (0)