php-extended/php-information-log-visitor

An intermediary library to have information visitors with psr-3 logging


Keywords
log, visitor, psr-3, information
License
MIT

Documentation

php-information-log-visitor

An intermediary library to have information visitors with psr-3 logging

Installation

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.

Basic Usage

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);

License

MIT (See license file).