php-extended/php-information-log-visitor

This package is abandoned and no longer maintained. The author suggests using the php-extended/php-information-object package instead.

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

3.3.12 2021-06-25 18:50 UTC

README

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

coverage build status

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