Returns a configured logger instance for the given $channel. If no FactoryCallback
is registered it will return an instance of {@link \Psr\Log\NullLogger}.

@param $channel
@returns LoggerInterface
@throws RuntimeException
516486
public static function getLogger($channel)
    {
        $callback = self::$callback;
        if (null === $callback) {
            return new NullLogger();
        }

        $logger = $callback($channel);
        if ($logger instanceof LoggerInterface) {
            return $logger;
        }

        throw new RuntimeException('Callback did not return an instance of \Psr\Log\LoggerInterface!');
    }
314762
public function getLogger($channel = 'default')
    {
        if (isset($this->loggers[$channel])) {
            return $this->loggers[$channel];
        }

        /** @var Logger $logger */
        $logger = $this->getContainer()->get(LoggerInterface::class, [$channel]);

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

        /** @var LoggerInterface $contract */
        $contract = $this->validateContract($this->loggers[$channel], LoggerInterface::class);
        return $contract;
    }
571192
public function getLogger($loggerName)
    {

        try {
            // first let's see if we've an application logger registered
            if ($logger = $this->getApplication()->getLogger($loggerName)) {
                return $logger;
            }

            // then try to load the global logger instance if available
            return $this->getApplication()->getNamingDirectory()->search(sprintf('php:global/log/%s', $loggerName));

        } catch (NamingException $ne) {
            // do nothing, we simply have no logger with the requested name
        }
    }
310549
public function channel($channel)
    {
        $channel = $this->client->get(config('twitch-api.api_url') . '/kraken/channels/' . $channel);

        return $channel->json();
    }
1055595
function resolve($channel) {
        if($channel instanceof \CharlotteDunois\Yasmin\Interfaces\ChannelInterface) {
            return $channel;
        }
        
        if(\is_int($channel)) {
            $channel = (string) $channel;
        }
        
        if(\is_string($channel) && parent::has($channel)) {
            return parent::get($channel);
        }
        
        throw new \InvalidArgumentException('Unable to resolve unknown channel');
    }
447227
public function updateChannel(Channel $channel)
    {
        $op = $this->sendUpdateChannelOperation($channel);

        // waiting for create operation finishes
        $op = $this->awaitOperation($op);

        if ($op->getState() != OperationState::Succeeded) {
            return null;
        }

        // get and return the createChannel
        return $this->getChannel($channel->getId());
    }
496304
public static function getLogger(array $context = array())
    {
        $str = \Wedeto\Util\Functions::str($context);
        if (self::$logger_factory === null)
            return new NullLogger();

        return self::$logger_factory->get(array($context['class'] ?? "Wedeto.UndefinedLogger"));
    }
353929
public function getChannel($channel)
    {
        $channelId = Utilities::getEntityId(
            $channel,
            'WindowsAzure\MediaServices\Models\Channel'
        );

        return Channel::createFromOptions($this->_getEntity("Channels('{$channelId}')"));
    }
408999
public function getLogger($name = null)
    {
        $name = is_null($name) ? $this->defaultLogger : $name;
        $name = "{$this->getPrefix()}$name";
        if (!isset(static::$_loggers[$name])) {
            static::$_loggers[$name] = new Logger($name);
            $this->_setDefaultHandlers(static::$_loggers[$name]);
        }
        return static::$_loggers[$name];
    }
320049
protected static function parse_channels($channels)
    {
        if ($channels instanceof Channel) {
            $channels = array($channels);
        } elseif (is_string($channels)) {
            $channels = array(new Channel($channels));
        }
        if (count($channels) == 0) {
            throw new \RuntimeException('channels length is 0');
        }
        return $channels;
    }
183961
public function build($service = null)
    {
        if (!$this->sender) {
            $this->sender = $this->buildGuzzleSender();
        }

        if (!$this->factory) {
            throw new RuntimeException("You need to provide a configuration or a factory for requests");
        }

        if (!$this->logger) {
            $this->logger = new NullLogger();
        }

        return $this->buildClient($this->factory, $this->sender, $this->logger, $service);
    }
216731
public static function get($channel)
    {
        // in case an object is passed in we use the base class name as the channel
        if (is_object($channel)) {
            $ref = new \ReflectionClass($channel);
            $channel = $ref->getShortName();
        }

        // custom log channels need to be registered in advance using self::register()
        if (!self::channelExists($channel)) {

            // use default logger object if set or fallback to builtin logger
            if (self::channelExists(self::DEFAULT_LOGGER)) {
                self::$loggers[$channel] = self::$loggers[self::DEFAULT_LOGGER];
            } else {
                $file = empty(self::$file) ? __DIR__.'/../../../app/logs/vatsimphp.log' : self::$file;
                self::$loggers[$channel] = new Logger($channel, $file, self::$level);
            }
        }

        return self::$loggers[$channel];
    }
633931
public function get(string $identifier): \Psr\Log\LoggerInterface
    {
        if (isset($this->instances[$identifier])) {
            return $this->instances[$identifier];
        }

        if (!isset($this->configuration[$identifier])) {
            throw new \InvalidArgumentException(sprintf('The given log identifier "%s" was not configured for the "%s" factory.', htmlspecialchars($identifier), self::class), 1515355505545);
        }

        if (!class_exists(Logger::class)) {
            throw new \Exception('To use the default logging you have to have the "neos/flow-log" package installed. It seems you miss it, so install it via "composer require neos/flow-log".', 1515437383589);
        }

        $backends = $this->instantiateBackends($this->configuration[$identifier]);

        $logger = new Logger($backends);
        $this->instances[$identifier] = $logger;
        return $logger;
    }
147899
public function hasLogger($channel): bool
    {
        $channel = strtolower($channel);

        return isset($this->loggers[$channel]);
    }
929026
public static function get(string $channel, array $handlers)
    {
        $logger = new static();
        return $logger->setUid(static::generateUid())
            ->setHandlers($handlers)
            ->setChannel($channel);
    }
1081678
protected function getFromCache($channel)
    {
        if (!$this->cache) {
            throw new LogicException('You need set to cache provider');
        }
        if ($this->getCache()->has($channel)) {
            return $this->getCache()->get($channel);
        }

        return false;
    }
660941
public static function getLogger()
    {
        $logger = null;
        try {
            $logger = Injector::inst()->get('SilverStripe\Omnipay\Logger');
        } catch (NotFoundExceptionInterface $e) {
            /* no op */
        }
        return $logger;
    }