コード例 #1
0
 /**
  *
  * @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;
     }
 }
コード例 #2
0
 public function __construct()
 {
     parent::__construct(self::TYPE);
 }
コード例 #3
0
 /**
  *
  * @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;
     }
 }