Sets a logger instance on the object.

@param \Psr\Log\LoggerInterface $logger
767352
public function setLogger(LoggerInterface $logger) : void
    {
        if ($this instanceof Wrapper) {
            $estimator = $this->base();
            
            if ($estimator instanceof Verbose) {
                $estimator->setLogger($logger);
            }
        }

        $this->logger = $logger;
    }
496139
public function setLogger(\sb\Logger\Base $logger, $logname=''){
        $this->logger = $logger;
        $this->log_name = $logname ? $logname : get_called_class();
        $this->log_name = preg_replace("~[^\w+]~", "_", $this->log_name);
    }
348975
private static function logLineHasLogger($logger, $line)
    {
        if ($logger === null) {
            return true;
        }

        return array_key_exists('logger', $line) && $line['logger'] == $logger;
    }
893405
public static function register(LoggerInterface $logger = null)
    {
        $handler = new static($logger);

        set_error_handler(array($handler, 'handleError'));
        register_shutdown_function(array($handler, 'handleFatalError'));

        set_exception_handler(array($handler, 'handleException'));
    }
674684
public final function setLogger( ?LoggerInterface $logger )
   {

      $this->_options[ 'logger' ] = null === $logger ? new NullLogger() : $logger;

      unset( $this->_options[ 'data' ] );

      return $this;

   }
109997
def set_logger(self):
        
        self.logger = logging.getLogger(self.logger_name)
        self.logger.setLevel(self.logger_level)
267224
public function setLogger(LoggerInterface $logger):void{
		$this->logger = $logger;
		$this->driver->setLogger($logger);
		$this->query->setLogger($logger);
	}
1034077
def setLogger( logger )
      if logger
         if logger.is_a?( Logger )
            if @logger and @logger != logger
               @logger.closeLogFile()
            end
            @logger = logger
         end
      else
         @logger.closeLogFile() if @logger
         @logger = nil
      end
   end
1348968
public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
        $this->factory->setLogger($logger);
        return $this;
    }
1101161
public function register(string $key, LoggerInterface $logger)
    {
        $this->loggers[$key] = $logger;
        $logger->writeHeader();
    }
851212
public function setLogger($value)
    {
        if ($value === null || $value instanceof LoggerInterface) {
            $this->logger = $value;
        } else {
            $this->logger = new LoggerWrapper($value);
        }
        if ($this->apiClient !== null) {
            $this->apiClient->setLogger($this->logger);
        }
    }
848065
public function log( \Monolog\Logger $logger) {
        $reflection = new \ReflectionClass($this);
        $logger->error($this->getMessage(), [
            'type' => $reflection->getShortName(),
            'code' => $this->getCode(),
            'line' => $this->getLine(),
            'file' => $this->getFile(),
            'trace' => $this->getTrace(),
            'context' => $this->getContext()
        ]);
    }
2114
public function removeLoggerByInstance($logger, $trigger = true) {
        foreach ($this->loggers as $key => $addedLogger) {
            if ($addedLogger[0] === $logger) {
                unset($this->loggers[$key]);
                return $this;
            }
        }

        if ($trigger) {
            $class = get_class($logger);
            trigger_error("Logger $class was removed without being added.");
        }

        return $this;
    }
41290
public function dumpTo(LoggerInterface $logger)
    {
        if (empty($this->sessionLog)) {
            return $this;
        }

        $logger->write(new LogRecord(null, "=== Detailed session log dump begin ==================", null));
        foreach ($this->sessionLog as $record) {
            $logger->write($record); // historical log dumped with actual event times
        }
        $logger->write(new LogRecord(null, "=== Detailed session log dump end ====================", null));

        return $this;
    }
677643
private function configureLogger(\n2n\log4php\Logger $logger, $config) {
		$loggerName = $logger->getName();
		
		// Set logger level
		if (isset($config['level'])) {
			$level = \n2n\log4php\LoggerLevel::toLevel($config['level']);
			if (isset($level)) {
				$logger->setLevel($level);
			} else {
				$this->warn("Invalid level value [{$config['level']}] specified for logger [$loggerName]. Ignoring level definition.");
			}
		}
		
		// Link appenders to logger
		if (isset($config['appenders'])) {
			foreach($config['appenders'] as $appenderName) {
				if (isset($this->appenders[$appenderName])) {
					$logger->addAppender($this->appenders[$appenderName]);
				} else {
					$this->warn("Nonexistnant appender [$appenderName] linked to logger [$loggerName].");
				}
			}
		}
		
		// Set logger additivity
		if (isset($config['additivity'])) {
			try {
				$additivity = \n2n\log4php\option\OptionConverter::toBooleanEx($config['additivity'], null);
				$logger->setAdditivity($additivity);
			} catch (Exception $ex) {
				$this->warn("Invalid additivity value [{$config['additivity']}] specified for logger [$loggerName]. Ignoring additivity setting.");
			}
		}
	}
543966
protected static function getLoggerId(\Plop\LoggerInterface $logger)
    {
        $func   = $logger->getMethod();
        $cls    = $logger->getClass();
        $ns     = $logger->getNamespace();
        return "$func:$cls:$ns";
    }
946295
def logger(self, logger):
        """"""
        if logger is None or not isinstance(logger, Logger):
            raise ValueError("Logger can not be set to None, and must be of type logging.Logger")

        self._logger = logger