thruster / logger-wrap
Thruster LoggerWrap Component wraps LoggerInterface and provides LoggerInterface with optional logging
1.0.0
2019-05-02 10:59 UTC
Requires
- php: >=7.3
- psr/log: ^1.1
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-29 05:33:22 UTC
README
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.