示例#1
0
文件: LogInspector.php 项目: kl07/log
 /**
  * Method to add an entry to the appropriate loggers.
  *
  * @param   LogEntry  $entry  The entry to add.
  *
  * @return  void
  *
  * @since   1.0
  */
 public function addLogEntry(LogEntry $entry)
 {
     $this->queue[] = $entry;
     parent::addLogEntry($entry);
 }
 /**
  * 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 self());
     }
     // If the entry object isn't a JLogEntry object let's make one.
     if (!$entry instanceof Entry) {
         $entry = new Entry((string) $entry, $priority, $category, $date);
     }
     self::$instance->addLogEntry($entry);
 }