Installation:
composer require eightpoints/assist-bundle:dev-master
Add to AppKernel.php:
new EightPoints\Bundle\AssistBundle\AssistBundle(),
First Use Case:
Replace your Symfony console output with ConsoleTimestampOutput for timestamped logs:
use EightPoints\Bundle\AssistBundle\Console\Output\ConsoleTimestampOutput;
$output = new ConsoleTimestampOutput();
$application->run($input, $output);
CommandTimestampOutput: Add timestamps to CLI output (e.g., for debugging long-running commands).Helpers section in the README for additional utilities (if any are documented).Workflow:
app/console:
$output = new ConsoleTimestampOutput();
$this->getHelperSet()->set($output, 'output');
$output->writeln('<info>Processing...</info>');
// Output: [HH:MM:SS :: 0.001] Processing...
class MyCommand extends ContainerAwareCommand {
protected function configure() {
$this->getHelperSet()->set(
new ConsoleTimestampOutput(),
'output'
);
}
}
ConsoleTimestampOutput:
class CustomTimestampOutput extends ConsoleTimestampOutput {
protected function getTimestampFormat() {
return 'Y-m-d H:i:s.u';
}
}
Outdated Codebase:
ContainerAwareCommand is deprecated in Symfony 4+).Limited Documentation:
CommandTimestampOutput.No Laravel Support:
Console\Output\OutputInterface changes).getTimestampFormat()).Add custom helpers:
Helper namespace or create a wrapper service in Symfony.# services.yml (Symfony 2)
eightpoints.assist.helper.my_helper:
class: My\Custom\Helper
tags:
- { name: eightpoints.assist.helper }
Leverage for logging:
$output = new ConsoleTimestampOutput();
$output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
$output->writeToFile('command.log');
config.yml: Bundle relies on autoloading. Ensure EightPoints\Bundle\AssistBundle is registered in AppKernel.php-compat).How can I help you explore Laravel packages today?