use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Formatter\OutputFormatterStyle; $output = new ConsoleOutput(); $style = new OutputFormatterStyle('blue', 'white', array('bold', 'blink')); $output->getFormatter()->setStyle('warning', $style); $output->writeln('WARNING: do not proceed!');
use Symfony\Component\Console\Output\ConsoleOutput; $output = new ConsoleOutput(); $output->getFormatter()->setStyle('error', new OutputFormatterStyle('white', 'red', array('bold'))); $output->writeln('This example sets a custom style for an "error" tag and uses it to format an error message. These examples use the Symfony Console Component library.ERROR: something went wrong!');