Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
60.00% |
3 / 5 |
CRAP | |
62.50% |
5 / 8 |
LoggableTrait | |
0.00% |
0 / 1 |
|
60.00% |
3 / 5 |
7.90 | |
62.50% |
5 / 8 |
setLogger(\aae\log\Loggable $logger = null) | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
getLogger() | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
log($message, $eventType = AbstractLogger::NORMAL) | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
hasLogger() | |
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
|||
logError(\Exception $e) | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
<?php | |
/** | |
* | |
*/ | |
namespace aae\log { | |
/** | |
* @author Axel Ancona Esselmann | |
* @package aae\api | |
*/ | |
trait LoggableTrait { | |
private $_logger = null; | |
public function setLogger(\aae\log\Loggable $logger = null) { | |
$this->_logger = $logger; | |
} | |
public function getLogger() { | |
return $this->_logger; | |
} | |
public function log($message, $eventType = AbstractLogger::NORMAL) { | |
$this->_logger->log($message, $eventType); | |
} | |
public function hasLogger() { | |
return (is_null($this->_logger)) ? false : true; | |
} | |
public function logError(\Exception $e) { | |
$this->_logger->logError($e); | |
} | |
} | |
} |