Download the PHP package auron-consulting-oss/php-console-logger without Composer
On this page you can find all versions of the php package auron-consulting-oss/php-console-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download auron-consulting-oss/php-console-logger
More information about auron-consulting-oss/php-console-logger
Files in auron-consulting-oss/php-console-logger
Package php-console-logger
Short Description Simple PSR-3 compliant console logger for PHP
License Apache-2.0
Informations about the package php-console-logger
PHP Console Logger
PhpConsoleLogger is a small class that implements a way to display messages in a console with an interface which is PSR-3 compatible. This means you can drop it in as a logger on code that is PSR-3 LoggerAwareInterface compatible and away you go.
This logger is really meant to be used for command line scripts due to shell-specific colouring commands.
You might want to use this on those command line scripts we all use to do things like migrations, data fixes etc; without the overhead of adding a full-on PHP console suite.
Requirements
PHP 7.2+ ext-json
Installation
The preferred method is through composer, via . You can always download and install manually, but you'd need to somehow shoehorn both psr/log and PhpConsoleLogger into your autoload mechanism.
Upgrading
If upgrading from 1.x, the logger will now by default print a timestamp next to the log message. You can disable it
by passing false
to the constructor.
Usage
Contributing
Fork this repo, do your stuff, send a PR. Tests are mandatory:
- PHP unit coverage must be 100%
- Infection MSI must be 100%
- PHPStan must show no errors
The provided Makefile has all the basic test targets and is what's in use in CI.
Examples
I have provided with an example (code and output below) you can run by running .
Which looks like: