Skip to content

Commit cacd51f

Browse files
committed
Rename to logger
1 parent 002bc00 commit cacd51f

File tree

5 files changed

+27
-36
lines changed

5 files changed

+27
-36
lines changed

src/Deployer.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222
use Deployer\Component\PharUpdate\Console\Command as PharUpdateCommand;
2323
use Deployer\Component\PharUpdate\Console\Helper as PharUpdateHelper;
2424
use Deployer\Component\Pimple\Container;
25-
use Deployer\ProcessRunner\Printer;
25+
use Deployer\Logger\Logger;
2626
use Deployer\ProcessRunner\ProcessRunner;
2727
use Deployer\Ssh\SshClient;
28-
use Deployer\Configuration;
2928
use Deployer\Executor\Master;
3029
use Deployer\Executor\Messenger;
3130
use Deployer\Host\Host;
@@ -63,7 +62,7 @@
6362
* @property Selector $selector
6463
* @property Master $master
6564
* @property Messenger $messenger
66-
* @property Printer $pop
65+
* @property Logger $logger
6766
* @property Collection $fail
6867
* @property InputDefinition $inputDefinition
6968
* @property Importer $importer
@@ -127,17 +126,17 @@ public function __construct(Application $console)
127126
? new FileHandler($this['log'])
128127
: new NullHandler();
129128
};
130-
$this['pop'] = function ($c) {
131-
return new Printer($c['output'], $this['logHandler']);
129+
$this['logger'] = function ($c) {
130+
return new Logger($c['output'], $this['logHandler']);
132131
};
133132
$this['sshClient'] = function ($c) {
134-
return new SshClient($c['output'], $c['pop']);
133+
return new SshClient($c['output'], $c['logger']);
135134
};
136135
$this['rsync'] = function ($c) {
137-
return new Rsync($c['pop'], $c['output']);
136+
return new Rsync($c['output'], $c['logger']);
138137
};
139138
$this['processRunner'] = function ($c) {
140-
return new ProcessRunner($c['pop']);
139+
return new ProcessRunner($c['logger']);
141140
};
142141
$this['tasks'] = function () {
143142
return new TaskCollection();
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
* file that was distributed with this source code.
99
*/
1010

11-
namespace Deployer\ProcessRunner;
11+
namespace Deployer\Logger;
1212

1313
use Deployer\Host\Host;
1414
use Deployer\Logger\Handler\HandlerInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616

17-
class Printer
17+
class Logger
1818
{
1919
private OutputInterface $output;
2020
private HandlerInterface $log;

src/ProcessRunner/ProcessRunner.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@
1313
use Deployer\Exception\RunException;
1414
use Deployer\Exception\TimeoutException;
1515
use Deployer\Host\Host;
16+
use Deployer\Logger\Logger;
1617
use Deployer\Ssh\RunParams;
1718
use Symfony\Component\Process\Exception\ProcessFailedException;
1819
use Symfony\Component\Process\Exception\ProcessTimedOutException;
1920
use Symfony\Component\Process\Process;
20-
2121
use function Deployer\Support\deployer_root;
2222
use function Deployer\Support\env_stringify;
2323
use function Deployer\Support\replace_secrets;
2424

2525
class ProcessRunner
2626
{
27-
private Printer $pop;
27+
private Logger $logger;
2828

29-
public function __construct(Printer $pop)
29+
public function __construct(Logger $logger)
3030
{
31-
$this->pop = $pop;
31+
$this->logger = $logger;
3232
}
3333

3434
public function run(Host $host, string $command, RunParams $params): string
3535
{
36-
$this->pop->command($host, 'run', $command);
36+
$this->logger->command($host, 'run', $command);
3737

38-
$terminalOutput = $this->pop->callback($host, $params->forceOutput);
38+
$terminalOutput = $this->logger->callback($host, $params->forceOutput);
3939
$callback = function ($type, $buffer) use ($host, $terminalOutput) {
4040
$terminalOutput($type, $buffer);
4141
};

src/Ssh/SshClient.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,25 @@
1010

1111
namespace Deployer\Ssh;
1212

13-
use Deployer\ProcessRunner\Printer;
1413
use Deployer\Exception\RunException;
1514
use Deployer\Exception\TimeoutException;
1615
use Deployer\Host\Host;
16+
use Deployer\Logger\Logger;
1717
use Symfony\Component\Console\Output\OutputInterface;
1818
use Symfony\Component\Process\Exception\ProcessTimedOutException;
1919
use Symfony\Component\Process\Process;
20-
2120
use function Deployer\Support\env_stringify;
2221
use function Deployer\Support\replace_secrets;
2322

2423
class SshClient
2524
{
2625
private OutputInterface $output;
27-
private Printer $pop;
26+
private Logger $logger;
2827

29-
public function __construct(OutputInterface $output, Printer $pop)
28+
public function __construct(OutputInterface $output, Logger $logger)
3029
{
3130
$this->output = $output;
32-
$this->pop = $pop;
31+
$this->logger = $logger;
3332
}
3433

3534
public function run(Host $host, string $command, RunParams $params): string
@@ -60,7 +59,7 @@ public function run(Host $host, string $command, RunParams $params): string
6059
$command = "export $env; $command";
6160
}
6261

63-
$this->pop->command($host, 'run', $command);
62+
$this->logger->command($host, 'run', $command);
6463

6564
$process = new Process($ssh);
6665
$process
@@ -69,7 +68,7 @@ public function run(Host $host, string $command, RunParams $params): string
6968
->setIdleTimeout($params->idleTimeout);
7069

7170
$callback = function ($type, $buffer) use ($params, $host) {
72-
$this->pop->callback($host, $params->forceOutput)($type, $buffer);
71+
$this->logger->callback($host, $params->forceOutput)($type, $buffer);
7372
};
7473

7574
try {

src/Utility/Rsync.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,24 @@
1010

1111
namespace Deployer\Utility;
1212

13-
use Deployer\ProcessRunner\Printer;
1413
use Deployer\Exception\RunException;
1514
use Deployer\Host\Host;
15+
use Deployer\Logger\Logger;
1616
use Symfony\Component\Console\Helper\ProgressBar;
1717
use Symfony\Component\Console\Output\OutputInterface;
1818
use Symfony\Component\Process\Exception\ProcessFailedException;
1919
use Symfony\Component\Process\Process;
20-
2120
use function Deployer\writeln;
2221

2322
class Rsync
2423
{
25-
/**
26-
* @var Printer
27-
*/
28-
private $pop;
29-
/**
30-
* @var OutputInterface
31-
*/
32-
private $output;
24+
private OutputInterface $output;
25+
private Logger $logger;
3326

34-
public function __construct(Printer $pop, OutputInterface $output)
27+
public function __construct(OutputInterface $output, Logger $logger)
3528
{
36-
$this->pop = $pop;
3729
$this->output = $output;
30+
$this->logger = $logger;
3831
}
3932

4033
/**
@@ -113,7 +106,7 @@ function (string $value) {
113106
return;
114107
}
115108
if ($this->output->isVerbose()) {
116-
$this->pop->printBuffer($type, $host, $buffer);
109+
$this->logger->printBuffer($type, $host, $buffer);
117110
}
118111
};
119112

0 commit comments

Comments
 (0)