/** * * @param Gpf_Log_LoggerBase $logger * @param int $logLevel * @return Gpf_Log_LoggerBase */ public function addLogger(Gpf_Log_LoggerBase $logger, $logLevel) { if (!$this->checkLoggerTypeExists($logger->getType())) { $logger->setLogLevel($logLevel); $this->loggers[$logger->getType()] = $logger; return $logger; } else { $ll = new Gpf_Log_LoggerDatabase(); $existingLogger = $this->loggers[$logger->getType()]; if ($existingLogger->getLogLevel() > $logLevel) { $existingLogger->setLogLevel($logLevel); } return $existingLogger; } }
public function __construct() { parent::__construct(self::TYPE); }
/** * * @param Gpf_Log_LoggerBase $logger * @param int $logLevel * @return Gpf_Log_LoggerBase */ public function addLogger(Gpf_Log_LoggerBase $logger, $logLevel) { $this->enableType($logger->getType()); if ($logger->getType() == Gpf_Log_LoggerDisplay::TYPE) { $this->logToDisplay = true; } if (!$this->checkLoggerTypeExists($logger->getType())) { $logger->setLogLevel($logLevel); $this->loggers[$logger->getType()] = $logger; return $logger; } else { $ll = new Gpf_Log_LoggerDatabase(); $existingLogger = $this->loggers[$logger->getType()]; if ($existingLogger->getLogLevel() > $logLevel) { $existingLogger->setLogLevel($logLevel); } return $existingLogger; } }