nackjicholson/monolog-symfony2-console

Monolog for Symfony2 Console Component output.

0.0.2 2014-06-20 05:15 UTC

This package is not auto-updated.

Last update: 2024-05-07 00:52:10 UTC


README

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.

Install

"require": {
    "nackjicholson/monolog-symfony2-console": "0.0.2"
}

composer require nackjicholson/monolog-symfony2-console:0.0.x

Basic Usage:

$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!');

example