示例#1
0
 /**
  * Method to add an entry to the log.
  *
  * @param   mixed    $entry     The JLogEntry object to add to the log or the message for a new JLogEntry object.
  * @param   integer  $priority  Message priority.
  * @param   string   $category  Type of entry
  * @param   string   $date      Date of entry (defaults to now if not specified or blank)
  *
  * @return  void
  *
  * @since   11.1
  */
 public static function add($entry, $priority = self::INFO, $category = '', $date = null)
 {
     // Automatically instantiate the singleton object if not already done.
     if (empty(self::$instance)) {
         self::setInstance(new JLog());
     }
     // If the entry object isn't a JLogEntry object let's make one.
     if (!$entry instanceof JLogEntry) {
         $entry = new JLogEntry((string) $entry, $priority, $category, $date);
     }
     self::$instance->addLogEntry($entry);
 }
示例#2
0
 public function addLogEntry(JLogEntry $entry)
 {
     $this->queue[] = $entry;
     return parent::addLogEntry($entry);
 }