Skip to content

Commit cb39c36

Browse files
committed
Rename to writeln
1 parent c6f50db commit cb39c36

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/Logger/Handler/FileHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(string $filePath)
2222
$this->filePath = $filePath;
2323
}
2424

25-
public function log(string $message): void
25+
public function writeln(string $message): void
2626
{
2727
file_put_contents($this->filePath, $message . "\n", FILE_APPEND);
2828
}

src/Logger/Handler/HandlerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
interface HandlerInterface
1414
{
15-
public function log(string $message): void;
15+
public function writeln(string $message): void;
1616
}

src/Logger/Handler/NullHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
class NullHandler implements HandlerInterface
1414
{
15-
public function log(string $message): void {}
15+
public function writeln(string $message): void {}
1616
}

src/Logger/Logger.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function command(Host $host, string $type, string $command): void
3737
if ($this->output->isVerbose()) {
3838
$this->output->writeln("[$host] <fg=green;options=bold>$type</> $command");
3939
}
40-
$this->fileLog->log("[{$host->getAlias()}] $type: $command");
40+
$this->fileLog->writeln("[{$host->getAlias()}] $type: $command");
4141
}
4242

4343
public function print(Host $host, string $buffer, bool $force = false): void
@@ -54,7 +54,7 @@ public function print(Host $host, string $buffer, bool $force = false): void
5454
if (empty($line)) {
5555
return;
5656
}
57-
$this->fileLog->log("[{$host->getAlias()}] $line");
57+
$this->fileLog->writeln("[{$host->getAlias()}] $line");
5858
}
5959
}
6060

@@ -70,7 +70,7 @@ public function startTask(Task $task): void
7070
} else {
7171
$this->output->writeln("<fg=cyan;options=bold>task</> {$task->getName()}");
7272
}
73-
$this->fileLog->log("# task {$task->getName()}");
73+
$this->fileLog->writeln("# task {$task->getName()}");
7474
}
7575

7676
public function endTask(Task $task): void
@@ -95,7 +95,7 @@ public function endTask(Task $task): void
9595
$this->output->writeln("<fg=yellow;options=bold>done</> {$task->getName()} $taskTime");
9696
}
9797

98-
$this->fileLog->log("# done {$task->getName()} $taskTime");
98+
$this->fileLog->writeln("# done {$task->getName()} $taskTime");
9999
}
100100

101101
public function endOnHost(Host $host): void
@@ -104,7 +104,7 @@ public function endOnHost(Host $host): void
104104
$this->output->writeln("<fg=yellow;options=bold>done</> on $host");
105105
}
106106

107-
$this->fileLog->log("# done on {$host->getAlias()}");
107+
$this->fileLog->writeln("# done on {$host->getAlias()}");
108108
}
109109

110110
public function renderException(Throwable $exception, Host $host): void
@@ -157,7 +157,7 @@ public function renderException(Throwable $exception, Host $host): void
157157
$this->output->write($message);
158158
}
159159

160-
$this->fileLog->log($exception->__toString());
160+
$this->fileLog->writeln($exception->__toString());
161161

162162
if ($exception->getPrevious()) {
163163
$this->renderException($exception->getPrevious(), $host);

0 commit comments

Comments
 (0)