-
-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it easier to enable the debug logger (#880)
* Add a default instance of the file logger to the container * Resolve the `logger` option from the container * Add tests * Add commented out comment in config for logger
- Loading branch information
1 parent
1b045d5
commit 25e1cd2
Showing
4 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Sentry\Laravel\Tests\Laravel; | ||
|
||
use Sentry\Laravel\Tests\TestCase; | ||
use Sentry\Logger\DebugFileLogger; | ||
use Sentry\State\HubInterface; | ||
|
||
class LaravelContainerConfigOptionsTest extends TestCase | ||
{ | ||
public function testLoggerIsNullByDefault(): void | ||
{ | ||
$logger = app(HubInterface::class)->getClient()->getOptions()->getLogger(); | ||
|
||
$this->assertNull($logger); | ||
} | ||
|
||
public function testLoggerIsResolvedFromDefaultSingleton(): void | ||
{ | ||
$this->resetApplicationWithConfig([ | ||
'sentry.logger' => DebugFileLogger::class, | ||
]); | ||
|
||
$logger = app(HubInterface::class)->getClient()->getOptions()->getLogger(); | ||
|
||
$this->assertInstanceOf(DebugFileLogger::class, $logger); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters