本文整理匯總了PHP中JLog::addLogEntry方法的典型用法代碼示例。如果您正苦於以下問題:PHP JLog::addLogEntry方法的具體用法?PHP JLog::addLogEntry怎麽用?PHP JLog::addLogEntry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JLog
的用法示例。
在下文中一共展示了JLog::addLogEntry方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: add
/**
* 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: addLogEntry
public function addLogEntry(JLogEntry $entry)
{
$this->queue[] = $entry;
return parent::addLogEntry($entry);
}