Skip to content

Latest commit

 

History

History
88 lines (59 loc) · 2.38 KB

README.md

File metadata and controls

88 lines (59 loc) · 2.38 KB

LoggerWrap

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Thruster LoggerWrap Component wraps LoggerInterface and provides LoggerInterface with optional logging

Install

Via Composer

$ composer require thruster/logger-wrap

Usage

Simple wrap your LoggerInterface object or not to enable/disable logging without bunch of if conditions around.

$logger = new Logger();
$wrappedLogger = new LoggerWrap($logger);

$wrappedLogger->info('Foo Bar'); // Will call $logger->info('Foo Bar');

Or not pass logger to disable logging

$wrappedLogger = new LoggerWrap();

$wrappedLogger->info('Foo Bar'); // Will not call anything

Testing

Run test cases

$ composer test

Run test cases with coverage (HTML format)

$ composer test-coverage

Run PHP style checker

$ composer check-style

Run PHP style fixer

$ composer fix-style

Contributing

Please see CONTRIBUTING and CONDUCT for details.

License

Please see License File for more information.