AbstractCommand::bootLogger()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of laravel.su package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace App\Console\Commands;
10
11
use Psr\Log\LoggerInterface;
12
use Illuminate\Console\Command;
13
use Monolog\Handler\StreamHandler;
14
use Illuminate\Foundation\Application;
15
16
/**
17
 * Class AbstractCommand.
18
 */
19
abstract class AbstractCommand extends Command
20
{
21
    /**
22
     * @param Application $app
23
     */
24
    protected function bootLogger(Application $app)
25
    {
26
        if ($app->isLocal()) {
27
            $app->make(LoggerInterface::class)
28
                ->getMonolog()
29
                ->pushHandler(new StreamHandler('php://stdout'));
30
        }
31
    }
32
}
33