2020-12-16 11:39:46 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace RetailCrm\DeliveryModuleBundle\Command\Traits;
|
|
|
|
|
|
|
|
trait CommandOutputFormatterTrait
|
|
|
|
{
|
|
|
|
public function getMessage(string $level, string $message): string
|
|
|
|
{
|
2022-08-01 12:56:48 +03:00
|
|
|
return sprintf('%s %s %s', date('Y-m-d H:i:s'), strtoupper($level), $message);
|
2020-12-16 11:39:46 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getInfoMessage(string $message): string
|
|
|
|
{
|
|
|
|
return $this->getMessage('INFO', $message);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getErrorMessage(string $message): string
|
|
|
|
{
|
|
|
|
return $this->getMessage('ERROR', $message);
|
|
|
|
}
|
2022-08-01 12:56:48 +03:00
|
|
|
}
|