1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37:
<?php
require __DIR__ . '/../vendor/autoload.php';
use splitbrain\phpcli\CLI;
use splitbrain\phpcli\Options;
class logging extends CLI
{
protected $logdefault = 'debug';
protected function setup(Options $options)
{
$options->setHelp('A very minimal example that demos the logging');
}
protected function main(Options $options)
{
$this->debug('This is a debug message');
$this->info('This is a info message');
$this->notice('This is a notice message');
$this->success('This is a success message');
$this->warning('This is a warning message');
$this->error('This is a error message');
$this->critical('This is a critical message');
$this->alert('This is a alert message');
$this->emergency('This is a emergency message');
throw new \Exception('Exception will be caught, too');
}
}
$cli = new logging();
$cli->run();