for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace WebServCo\Framework\Traits;
/**
* Log simple messages to both file and output.
*/
trait LogTrait
{
protected \WebServCo\Framework\Interfaces\LoggerInterface $fileLogger;
protected \WebServCo\Framework\Interfaces\OutputLoggerInterface $outputLogger;
* @param mixed $context
protected function logDebug(string $message, $context = []): void
$this->outputLogger->debug($message);
$this->fileLogger->debug($message, $context);
}
protected function logError(string $message, $context = []): void
$this->outputLogger->output($message);
$this->fileLogger->error($message, $context);
protected function logInfo(string $message, $context = []): void
$this->outputLogger->info($message);
$this->fileLogger->info($message, $context);
protected function logWarning(string $message, $context = []): void
$this->outputLogger->warning($message);
$this->fileLogger->warning($message, $context);