Return a logger's identifier.

\param Plop::LoggerInterface $logger
A logger whose identifier we're interested in.

\retval string
The logger's identifier.
543966
protected static function getLoggerId(\Plop\LoggerInterface $logger)
    {
        $func   = $logger->getMethod();
        $cls    = $logger->getClass();
        $ns     = $logger->getNamespace();
        return "$func:$cls:$ns";
    }
1118220
public function setLogger(LoggerInterface $logger)
	{
		$this->logger = $logger;

		foreach ($this->services as $name) {
			if ($this->$name && $this->$name instanceof \Psr\Log\LoggerAwareInterface) {
				$this->$name->setLogger($logger);
			}
		}

		return $this;
	}
1224531
public function setLoggerInstance(LoggerInterface $LogInterface = null)
    {
        $this->oLog = $LogInterface ?? new \Psr\Log\NullLogger();

        return $this;
    }
1275214
public function setLogger(LoggerInterface $logger)
    {
        $this->traitSetLogger($logger);
        foreach ($this->connections as $connection) {
            $connection->setLogger($logger);
        }
    }
1096332
public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
        $this->getClient()->setLogger($logger);
    }
1354092
public static Logger getLogger(final String logger)
   {
      LogAdapterFactory adapterFactory = getAdapterFactory();
      return adapterFactory.createLogAdapter(logger);
   }
1294119
public function setLogger(LoggerInterface $logger)
    {
        foreach ($this->adapters as $adapter) {
            if ($adapter instanceof LoggerAwareInterface) {
                $adapter->setLogger($logger);
            }
        }
        $this->logger = $logger;
    }
1114576
public static function createDefaultLogger(OutputInterface $output) : LoggerInterface
    {
        $logger = new Logger('browscap');
        $consoleLogger = new ConsoleLogger($output);
        $psrHandler = new PsrHandler($consoleLogger);

        $logger->pushHandler($psrHandler);

        /** @var callable $memoryProcessor */
        $memoryProcessor = new MemoryUsageProcessor(true);
        $logger->pushProcessor($memoryProcessor);

        /** @var callable $peakMemoryProcessor */
        $peakMemoryProcessor = new MemoryPeakUsageProcessor(true);
        $logger->pushProcessor($peakMemoryProcessor);

        ErrorHandler::register($logger);

        return $logger;
    }
615583
public function getAgents(LoggerInterface $logger): iterable
    {
        $regex = (new Regex())->getRegex();

        foreach ($this->files as $file) {
            $this->logger->info('    reading file ' . str_pad($file, 100, ' ', STR_PAD_RIGHT));

            $handle = @fopen($file, 'r');

            if (false === $handle) {
                $this->logger->emergency(new \RuntimeException('reading file ' . $file . ' caused an error'));
                continue;
            }

            $i = 1;

            while (!feof($handle)) {
                $line = fgets($handle, 65535);

                if (false === $line) {
                    continue;
                }
                ++$i;

                if (empty($line)) {
                    continue;
                }

                $lineMatches = [];

                if (!preg_match($regex, $line, $lineMatches)) {
                    $logger->error('no useragent found in line "' . $line . '" used regex: "' . $regex . '"');

                    continue;
                }

                if (isset($lineMatches['userAgentString'])) {
                    $agentOfLine = trim($lineMatches['userAgentString']);
                } else {
                    $agentOfLine = trim($this->extractAgent($line));
                }

                if (!is_string($agentOfLine) || empty($agentOfLine)) {
                    continue;
                }

                yield $agentOfLine;
            }

            fclose($handle);
        }
    }
302388
public static function register($channel, \Psr\Log\LoggerInterface $logger)
    {
        self::$loggers[$channel] = $logger;

        return $logger;
    }
1299255
public function getLogger(string $channel = null): \Psr\Log\LoggerInterface
    {
        if ($channel === null) {
            return $this->getContainer()->offsetGet('logger');
        }
        return $this->getContainer()->offsetGet('loggers')[$channel];
    }
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()
        ]);
    }
1314557
protected function callHandlers(\Plop\RecordInterface $record)
    {
        if (!count($this->handlers) && !$this->emittedWarning) {
            $stderr = $this->getStderr();
            fprintf(
                $stderr,
                'No handlers could be found for logger ("%s" in "%s")' . "\n",
                $this->cls .
                ($this->cls === null || $this->cls === '' ? '' : '::') .
                $this->method,
                $this->ns
            );
            fclose($stderr);
            $this->emittedWarning = true;
            return $this;
        }

        $this->handlers->handle($record);
        return $this;
    }
834276
private function use_default_handler( Logger $logger ) {

		$handler = $this->handlers_registry->find( HandlersRegistry::DEFAULT_NAME );
		if ( ! $handler instanceof HandlerInterface ) {
			return NULL;
		}

		/**
		 * Filters whether to use the default handler.
		 *
		 * @param bool             $use_default_handler
		 * @param Logger           $logger
		 * @param HandlerInterface $handler
		 */
		if ( ! apply_filters( self::FILTER_USE_DEFAULT_HANDLER, TRUE, $logger, $handler ) ) {
			return NULL;
		}

		return $handler;
	}
782867
public function setLogger( LoggerInterface $logger ) {
		$this->logger = $logger;
		$this->session->setLogger( $logger );
	}
172224
public function create() : LoggerInterface
    {
        $loggerType = $this->config['type'] ?? 'null';
        switch ($loggerType) {
            case 'file':
                return new Logger($this->config['path'], $this->config['level']);
            case 'null':
                return new NullLogger;
            default:
                throw new \RuntimeException('Invalid logger type');
        }
    }
172092
public function getLogger(OutputInterface $output)
    {
        if ($this->logger === null) {
            $this->logger = new ConsoleLogger($output);
        }
        return $this->logger;
    }