cliCommandLogToConsole

Adds a systemLogWriterCli object to the systemLog instance allowing all log messages from ALWAYS to current log level to be output on the command line as the application is executing. This is mainly for debugging.

Note: if using with cliCommandLog, this option should come LAST on the cli switch stack e.g. -oV will use the system default log level and NOT systemLogLevel::DEBUG as set by V. The correct order is -Vo.

// add output logging to app
$oApp = new cliApplication('example', 'A simple example.');
$oRequest = cliRequest::getInstance()->setApplication($oApp);
$oApp->getCommandChain()
    ->addCommand(
        new cliCommandLogToConsole($oRequest)
    )
$oApp->execute($oRequest);

// add verbose logging and output to console
$oApp = new cliApplication('example', 'A simple example.');
$oRequest = cliRequest::getInstance()->setApplication($oApp);
$oApp->getCommandChain()
    ->addCommand(new cliCommandLog($oRequest))
    ->addCommand(new cliCommandLogToConsole($oRequest))
$oApp->execute($oRequest);

Methods

public __construct($inRequest)

Creates a new console logger switch

public execute()

Executes the command adding the output logger


Inherited Methods

<  1  >