Set the logger that logs the full log message stream
when the destructor runs
@param \sb\Logger\Base $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);
    }
18815
def setLoggerLevel(self, logger, level):
        
        if logger == 'root':
            _log = logging.getLogger()
        else:
            _log = logging.getLogger(logger)
        
        _log.setLevel(level)
        
        if level == logging.NOTSET:
            self._loggerLevels.pop(logger, None)
        else:
            self._loggerLevels[logger] = level
436828
protected function setLogger()
  {
    $stream = new RotatingFileHandler($this->logFile, $this->importance);
    $stream->setFormatter($this->formatter);
    
    $this->logger = new MonologLogger($this->name);
    $this->logger->pushHandler($stream);
  }
1128251
public void setLogger(Logger logger) {
		this.logger = logger == null ? LoggerFactory.getLogger(getClass()) : logger;
	}
1353319
public function addLogger($channel, LoggerInterface $logger)
    {
        $channel = strtolower($channel);

        $this->loggers[$channel] = $logger;

        return $this;
    }
413236
public function addLogger(LoggerInterface $logger)
    {
        if ($this->isLoggerLoaded() && !($this->logger instanceof NullLogger)) {
            $logger = new LoggerAggregator([$logger, $this->logger]);
        }
        $this->logger = $logger;
        return $logger;
    }
417327
public function logger($logger = null)
    {
        if ($logger) {
            $this->_logger = $logger;
        }

        if ($this->_logger) {
            return $this->_logger;
        }

        $this->_logger = new QueryLogger();
        return $this->_logger;
    }
961336
public function setLogger($logger)
    {
        if (!method_exists($logger, 'info'))
        {
            throw new Exception('logger need have method "info($message)"');
        }
        if (!method_exists($logger, 'error'))
        {
            throw new Exception('logger need have method "error($message)"');
        }
        $this->logger = $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()
        ]);
    }
47406
public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
        if ($this->ownedFactory) {
            $this->readerFactory->setLogger($logger);
        }
    }
759700
public function setLogger(string $id, LoggerInterface $logger): self
    {
        $this->_loggers[$id] = $logger;

        return $this;
    }
1348968
public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
        $this->factory->setLogger($logger);
        return $this;
    }
1152909
public function setLogger(\BearFramework\App\ILogger $logger): self
    {
        if ($this->logger !== null) {
            throw new \Exception('A logger is already set!');
        }
        $this->logger = $logger;
        return $this;
    }
1058235
public static function registerExceptionHandler(Logger $logger)
    {
        // Only register once per instance
        if (self::$registeredExceptionHandler) {
            return false;
        }

        if ($logger === null) {
            throw new \Zend\Log\Exception\InvalidArgumentException('Invalid Logger specified');
        }

        set_exception_handler(
                    /* var $exception Exception */
            function (\Exception $exception) use ($logger) {
                    $msg = '';
                    $prev = $exception->getPrevious();
                    while ($prev !== null) {
                        $msg .= PHP_EOL.'Previous: '.$prev->getMessage().
                                 ' in '.$prev->getFile().' in line '.
                                 $prev->getLine().'.';
                        $prev = $prev->getPrevious();
                    }
                    $logger->log(ErrorLogger::ERR,
                            'Exception: '.$exception->getMessage().' in '.
                                     $exception->getFile().' in line '.
                                     $exception->getLine().'.'.$msg.PHP_EOL.
                                     'Trace:'.PHP_EOL.
                                     $exception->getTraceAsString());
                });
        self::$registeredExceptionHandler = true;

        return false;
    }
433704
private function applyDecorators(LoggerInterface $logger, array $config)
    {
        foreach ($this->decorators as $configKey => $decoratorClassName) {
            if (!isset($config[$configKey])) {
                continue;
            }
            if (!class_exists($decoratorClassName)) {
                throw new \RuntimeException('Decorator class not found: ' . $decoratorClassName);
            }
            if (!is_subclass_of($decoratorClassName, '\Phlib\Logger\Decorator\AbstractDecorator')) {
                throw new \RuntimeException('Decorator class invalid: ' . $decoratorClassName);
            }
            /** @var \Phlib\Logger\Decorator\AbstractDecorator $logger */
            $logger = new $decoratorClassName($logger, $config[$configKey]);
        }

        return $logger;
    }
445151
private function configureRootLogger(\n2n\log4php\LoggerHierarchy $hierarchy, $config) {
		$logger = $hierarchy->getRootLogger();
		$this->configureLogger($logger, $config);
	}
413594
protected function setLogger()
    {
        $settings = $this->module->getSettings('dev');

        $this->logger->printError(!empty($settings['print_error']))
            ->errorToException(!empty($settings['error_to_exception']))
            ->printBacktrace(!empty($settings['print_error_backtrace']));
    }