Monolog for Symfony2 Console Component output.
Why? Because StreamHandler
to php://stdout
is ugly, and Symfony2 Console Output is pretty.
But...you really shouldn't use this because symfony/MonologBridge is better.
"require": {
"nackjicholson/monolog-symfony2-console": "0.0.2"
}
composer require nackjicholson/monolog-symfony2-console:0.0.x
$output = new \Symfony\Component\Console\Output\ConsoleOutput();
$consoleFormatter = new \Nack\Monolog\Formatter\Symfony2ConsoleFormatter();
$consoleHandler = new \Nack\Monolog\Handler\Symfony2ConsoleHandler($output);
$consoleHandler->setFormatter($consoleFormatter);
$logger = new \Monolog\Logger('channel');
$logger->pushHandler($consoleHandler);
$logger->debug('Debug Life');
$logger->info('Just a little FYI');
$logger->notice('A little something to see here');
$logger->warning('Pay attention, be careful');
$logger->error('Your program broke, it happens');
$logger->critical('Oh my goodness, someone do something!');
$logger->emergency('It is all on fire! You may be fired!');