An intermediary library to have information visitors with psr-3 logging
An intermediary library to have information visitors with psr-3 logging
The installation of this library is made via composer.
Download composer.phar
from their website.
Then add to your composer.json :
"require": {
...
"php-extended/php-information-log-visitor": "^3",
...
}
Then run php composer.phar update
to install this library.
The autoloading of all classes of this library is made through composer's autoloader.
This library is made to have some logger that logs the fact that an information was processes, either successfully or that the processing failed.
As such, it should be used as a decorator to another visitor :
use PhpExtended\Information\LoggerInformationVisitor;
/* @var $logger \Psr\Log\LoggerInterface */
$logger = '<put there your psr-3 compliant logger>';
/* @var $visitor \PhpExtended\Information\InformationVisitorInterface */
$visitor = '<put there your other visitor>';
$loggerVisitor = new LoggerInformationVisitor($logger, $visitor);
/* Then use it to visit specific informations */
/* @var $information \PhpExtended\Information\InformationInterface */
$information->visit($loggerVisitor);
MIT (See license file).