Beispiel #1
0
 /**
  * @param array  $options
  * @param array  $loglevels
  * @param string $category
  */
 public function __construct(array $loglevels = array('ALL'), array $options, $category)
 {
     parent::__construct($loglevels);
     $levels_needed = 0;
     foreach ($loglevels as $level) {
         if (!array_key_exists(strtoupper($level), $this->log_levels)) {
             continue;
         }
         $levels_needed = $levels_needed | $this->mapped_levels[$this->log_levels[strtoupper($level)]];
     }
     // setup the logger for Joomla 1.7
     $this->category = $category;
     JLog::addLogger($options, $levels_needed, array($category));
 }
Beispiel #2
0
 /**
  * @param array  $loglevels
  * @param string $file
  * @param null   $options
  * @param null   $path
  */
 public function __construct(array $loglevels = array('ALL'), $file = 'error.php', $options = null, $path = null)
 {
     parent::__construct($loglevels);
     jimport('joomla.error.log');
     $this->instance = JLog::getInstance($file, $options, $path);
 }