Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
cesargb committed Oct 10, 2021
2 parents 0d3dcd8 + 59dddb6 commit 8713555
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/Helpers/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static function getLaravelLogFiles()
$files = [];

foreach (self::getHandlers() as $handler) {
if ($handler instanceof StreamHandler && !$handler instanceof RotatingFileHandler) {
if ($handler instanceof StreamHandler && ! $handler instanceof RotatingFileHandler) {
$files[] = $handler->getUrl();
}
}
Expand All @@ -29,7 +29,7 @@ public static function getLaravelLogFiles()
public static function closeHandlers()
{
foreach (self::getHandlers() as $handler) {
if ($handler instanceof StreamHandler && !$handler instanceof RotatingFileHandler) {
if ($handler instanceof StreamHandler && ! $handler instanceof RotatingFileHandler) {
if (method_exists($handler, 'close')) {
$handler->close();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Commands/RotateFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function itCanRotateFileMax()
{
$file = $this->tmpDir.'/file1';

for ($n = 0; $n < 5; ++$n) {
for ($n = 0; $n < 5; $n++) {
file_put_contents($file, 'test');

$resultCode = Artisan::call('rotate:files', [
Expand All @@ -76,7 +76,7 @@ public function itCanRotateFileMax()

$this->assertEquals(filesize($file), 0);

for ($n = 1; $n < 4; ++$n) {
for ($n = 1; $n < 4; $n++) {
$this->assertFileExists($file.'.'.$n.'.gz');
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Handlers/RotativeHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testItCanRotateLogsWithMaxfiles()

$this->app['config']->set('rotate.log_compress_files', true);

for ($n = 0; $n < 10; ++$n) {
for ($n = 0; $n < 10; $n++) {
$this->writeLog();

$this->assertGreaterThan(0, filesize(app()->storagePath().'/logs/laravel.log'));
Expand Down
24 changes: 12 additions & 12 deletions tests/RotateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ public function testItNotRotateLogsDaily()
public function testItCanRotateLogsCustomStreamFile()
{
$this->app['config']->set('logging.channels.custom', [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'with' => [
'stream' => app()->storagePath().'/logs/custom.log',
],
]);
'driver' => 'monolog',
'handler' => StreamHandler::class,
'with' => [
'stream' => app()->storagePath().'/logs/custom.log',
],
]);

$this->app['config']->set('logging.default', 'custom');

Expand All @@ -129,12 +129,12 @@ public function testItCanRotateLogsCustomStreamFile()
public function testItNotRotateLogsCustomStreamStd()
{
$this->app['config']->set('logging.channels.custom', [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'with' => [
'stream' => 'php://stdout',
],
]);
'driver' => 'monolog',
'handler' => StreamHandler::class,
'with' => [
'stream' => 'php://stdout',
],
]);

$this->app['config']->set('logging.default', 'custom');

Expand Down

0 comments on commit 8713555

Please sign in to comment.