Merge pull request #14 from gridnevalex/add_command_output_formatting
Add CommandOutputFormatterTrait
This commit is contained in:
commit
20ee49596b
@ -4,13 +4,18 @@ namespace RetailCrm\DeliveryModuleBundle\Command\Traits;
|
|||||||
|
|
||||||
trait CommandOutputFormatterTrait
|
trait CommandOutputFormatterTrait
|
||||||
{
|
{
|
||||||
public function output(string $level, string $message): string
|
public function getMessage(string $level, string $message): string
|
||||||
{
|
{
|
||||||
return sprintf("%s %s %s", date('Y-m-d H:i:s'), strtoupper($level), $message);
|
return sprintf("%s %s %s", date('Y-m-d H:i:s'), strtoupper($level), $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function infoOutput(string $message): string
|
public function getInfoMessage(string $message): string
|
||||||
{
|
{
|
||||||
return $this->output('INFO', $message);
|
return $this->getMessage('INFO', $message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getErrorMessage(string $message): string
|
||||||
|
{
|
||||||
|
return $this->getMessage('ERROR', $message);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user