Skip to content

Commit 87919d3

Browse files
committed
Use Log facade instead of helper for older Laravel versions
1 parent e54465f commit 87919d3

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

tests/Support/Kernel.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Console\Scheduling\Schedule;
66
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7+
use Illuminate\Support\Facades\Log;
78

89
class Kernel extends ConsoleKernel
910
{
@@ -16,9 +17,9 @@ protected function schedule(Schedule $schedule)
1617
{
1718
$schedule->command('test:command')->withoutOverlapping();
1819
$schedule->command('test:command2')->before(function () {
19-
logger()->info('log after');
20+
Log::info('log after');
2021
})->after(function () {
21-
logger()->warning('log before');
22+
Log::warning('log before');
2223
});
2324
}
2425
}

tests/Support/TestCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Tests\Support;
44

55
use Illuminate\Console\Command;
6+
use Illuminate\Support\Facades\Log;
67

78
class TestCommand extends Command
89
{
@@ -11,6 +12,6 @@ class TestCommand extends Command
1112

1213
public function handle()
1314
{
14-
logger('did something testy');
15+
Log::debug('did something testy');
1516
}
1617
}

tests/Support/TestCommand2.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Tests\Support;
44

55
use Illuminate\Console\Command;
6+
use Illuminate\Support\Facades\Log;
67

78
class TestCommand2 extends Command
89
{
@@ -12,6 +13,6 @@ class TestCommand2 extends Command
1213

1314
public function handle()
1415
{
15-
logger('did something testy');
16+
Log::debug('did something testy');
1617
}
1718
}

0 commit comments

Comments
 (0)