1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43:
<?php
namespace Baguette\Application;
use Psr\Log;
/**
* Logging trait for Application
*
* @author USAMI Kenta <tadsan@zonu.me>
* @package Baguette\Response
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
* @link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
*/
trait Logging
{
use Log\LoggerTrait;
/** @var \Psr\Log\LoggerInterface */
private $logging_logger;
/**
* Logs with an arbitrary level.
*
* @param mixed $level
* @param string $message
* @param array $context
* @return null
*/
public function log($level, $message, array $context = [])
{
return $this->logging_logger->log($level, $message, $context);
}
/**
* @param \Psr\Log\LoggerInterface $logger
*/
public function setLogger(Log\LoggerInterface $logger)
{
$this->logging_logger = $logger;
}
}