webCOMAND

comand::echo_event_log()

Echo the event log to standard output (stdout) in the simple, or optionally specified, format.

All previously logged events will be echoed immediately, and subsequent events will be echoed as they are logged, as they are logged.

Prototype

log echo_event_log(mixed $format = 'simple')

Parameters

  • format - An associative array log_stream config, or a string with one of the following event log formats.
    • simple - Output events in a very simple format:
      [<Formatted Timestamp>] <Type>: <Message>
    • plain - Output events in plain text, but with extras and child events also recorded.
      [<Formatted Timestamp>] <Type>: <Message>
      <Extra>
    • cli - Output events in plan text, without a timestamp, which works well for real-time output to the command-line interface.
    • html - <li class="event"><span class="datetime">[<Formatted Timestamp>]</span> <span class="<Type>"><Type></span>: <Message><div class="extra"><Extra></div></li>
    • html_simple - Similar to html, minus the timestamp.

Example

$repo = comand::repo();
if(!$repo) {
    echo("<p>Could not connected to repository:</p>");

    // echo any previously logged events in HTML format
    comand::echo_event_log('html');

    // this error will be echoed in HTML format
    comand::log_error("Existing");
    exit();
}