webCOMAND

comand::log_error()

Log an error event to the COMAND log.

Prototype

void log_event(string $text, mixed $extra = NULL, long $timestamp = NULL)

Parameters

  • text - Message about the event.
  • extra - Optional string, array or other data that corresponds to the event.
  • timestamp - Optional Unix timestamp representing when the event occurred.  The current time will be used if not provided.

Example

$repo = comand::repo();
if(!$repo) {
    // echo any previously logged and future events
    comand::echo_event_log();

    comand::log_error("Could not connect. Exiting.");
    exit();
}

Related