register a logger

@param array $loggers
977421
public function registerAll(array $loggers)
    {
        foreach($loggers as $key => $logger){
            $this->loggers[$key] = $logger;
            $logger->writeHeader();
        }
    }
1145014
private function registerAnnotations(array $annotations)
    {
        $kernel = $this
            ->container
            ->get('kernel');

        foreach ($annotations as $annotation) {
            AnnotationRegistry::registerFile($kernel
                ->locateResource($annotation)
            );
        }
    }
275642
public function registerLogger()
    {
        $this->app->extend('log', function($log) {
            return new Writer($log->getMonolog(), $log->getEventDispatcher());
        });
    }
1338969
public function registerListeners(array $listeners)
    {
        foreach ($listeners as $event => $listener) {
            $this->events[$event][] = $listener;
        }
    }
462420
protected function registerBaseServiceProviders()
    {
        $this->register(new EventServiceProvider($this));
        $this->register(new LogServiceProvider($this));
        $this->register(new RouteServiceProvider($this));
    }
140824
protected function registerCommands(array $commands)
    {
        foreach (array_keys($commands) as $command) {
            call_user_func([$this, "register{$command}Command"]);
        }

        $this->commands(array_values($commands));
    }
682678
def register_logger(self, logger):
        
        handler = CommandHandler(self)
        handler.setFormatter(CommandFormatter())
        logger.handlers = [handler]
        logger.propagate = False

        output = self.output
        level = logging.WARNING
        if output.is_debug():
            level = logging.DEBUG
        elif output.is_very_verbose() or output.is_verbose():
            level = logging.INFO

        logger.setLevel(level)
1121242
public static function register(LoggerInterface $logger = null, $cfg = null) {
            self::$registered = true;
            $class = get_called_class();
            $handler = new $class($logger, $cfg);

            register_shutdown_function([$handler, 'handle']);
            self::$lastRegisteredHandler = &$handler;

            return $handler;
        }
1125717
public function logEvent(array $events = [])
    {
        foreach ($events as $event) {
            if (!in_array($event, $this->loggerInstance->logEvents, true)) {
                $this->loggerInstance->logEvents[] = $event;
            }
        }

        return $this;
    }
77712
public static function setupFromArray(array $loggers) {
        foreach ($loggers as $logger) {
            if (!isset($logger['class'])) {
                throw new LoggerManagerException('Each logger configuration defined in the file [' . $configurationFilePath . '] has to define a "class" property');
            }
            if (!is_string($logger['class'])) {
                throw new LoggerManagerException('Each logger configuration defined in the file [' . $configurationFilePath . '] has to define a "class" property, as a string');
            }
            if (!isset($logger['level'])) {
                throw new LoggerManagerException('Each logger configuration defined in the file [' . $configurationFilePath . '] has to define a "level" property');
            }
            if (!is_string($logger['level'])) {
                throw new LoggerManagerException('Each logger configuration defined in the file [' . $configurationFilePath . '] has to define a "level" property, as a string');
            }
            if (!isset($logger['writers'])) {
                throw new LoggerManagerException('Each logger configuration defined in the file [' . $configurationFilePath . '] has to define a "writers" property');
            }
            if (!is_array($logger['writers'])) {
                throw new LoggerManagerException('Each logger configuration defined in the file [' . $configurationFilePath . '] has to define a "writers" property, as an array');
            }
        }

        self::$_loggers = $loggers;
    }
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'));
    }
460058
protected function registerPluginSubscribers(array $plugins)
    {
        $client = $this->getClient();
        foreach ($plugins as $plugin) {
            $this->validatePluginEvents($plugin);
            $callbacks = $plugin->getSubscribedEvents();
            foreach ($callbacks as $event => $callback) {
                $pluginCallback = [ $plugin, $callback ];
                if (is_callable($pluginCallback)) {
                    $callback = $pluginCallback;
                }
                $client->on($event, $callback);
            }
        }
    }
47406
public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
        if ($this->ownedFactory) {
            $this->readerFactory->setLogger($logger);
        }
    }
1101161
public function register(string $key, LoggerInterface $logger)
    {
        $this->loggers[$key] = $logger;
        $logger->writeHeader();
    }
86616
@Override
  public void registerLoggerProviderKeeper(final LoggerProviderKeeper keeper) {
    if (this.loggerProviderKeeper != null) {
      this.loggerProviderKeeper.close();
    }
    this.loggerProviderKeeper = keeper;
  }
312051
public function addLogger($loggerName, $logger)
    {
        if ($logger instanceof LoggerInterface) {
            self::$loggers[$loggerName] = $logger;
        } elseif ($this->debug) {
            throw new InvalidServiceException('Logger Service must implement'.__NAMESPACE__.'LoggerInterface');
        }
    }
182184
private function setLogger($logger)
    {
        $psr = 'Psr\\Log\\LoggerInterface';
        if (!is_a($logger, $psr)) {
            throw new InvalidArgumentException(
                sprintf('Expected an instance of %s', $psr)
            );
        }

        $this->logger = $logger;
    }