Completed
Push — master ( 4456fe...59e4d4 )
by Sébastien
03:55
created

LoggerTrait::logServerConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
ccs 8
cts 8
cp 1
rs 9.6666
cc 1
eloc 7
nc 1
nop 2
crap 1
1
<?php
2
3
namespace PjbServer\Tools\Console\Command;
4
5
use Symfony\Component\Console\Logger\ConsoleLogger;
6
use Symfony\Component\Console\Output\OutputInterface;
7
use PjbServer\Tools\StandaloneServer\Config;
8
9
trait LoggerTrait
10
{
11
12
    /**
13
     * @param OutputInterface $output
14
     * @return ConsoleLogger
15
     */
16 6
    public function getConsoleLogger(OutputInterface $output)
17
    {
18 6
        return new ConsoleLogger($output);
19
    }
20
21
    /**
22
     * @param ConsoleLogger $logger
23
     * @param Config $config
24
     */
25 6
    public function logServerConfig(ConsoleLogger $logger, Config $config)
26
    {
27 6
        $logger->info("* config port       :" . $config->getPort());
28 6
        $logger->info("* config log_file   :" . $config->getLogFile());
29 6
        $logger->info("* config pid_file   :" . $config->getPidFile());
30 6
        $logger->info("* config classpaths :" . implode(',', $config->getClasspaths()));
31 6
        $logger->info("* config java_bin   :" . $config->getJavaBin());
32 6
        $logger->info("* config server_jar :" . $config->getServerJar());
33 6
    }
34
}
35