Set logger

@param LoggerInterface $logger

@return HandlerBuilder

@throws AlreadyBuildedException
555296
public function setLogger(LoggerInterface $logger)
    {
        if ($this->handler) {
            throw new AlreadyBuildedException('The handler already builded.');
        }

        $this->logger = $logger;

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

        $this->logger = $logger;
    }
1096332
public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
        $this->getClient()->setLogger($logger);
    }
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;
	}
1114876
public function setParameterExtractor(ParameterExtractorInterface $extractor)
    {
        if ($this->handler) {
            throw new AlreadyBuildedException('The handler already builded.');
        }

        $this->parameterExtractor = $extractor;

        return $this;
    }
19000
public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;

        if ($this->stream instanceof LoggerAwareInterface) {
            $this->stream->setLogger($this->getLogger());
        }

        return $this;
    }
334808
public function setLogger(
        \Psr\Log\LoggerInterface $logger = null,
        $messageFormat = \GuzzleHttp\MessageFormatter::CLF
    ) {
        if ($logger === null) {
            $handler = new \Monolog\Handler\ErrorLogHandler(\Monolog\Handler\ErrorLogHandler::SAPI);
            $handler->setFormatter(new \Monolog\Formatter\LineFormatter('%message%'));
            $logger = new \Monolog\Logger('HTTP Log', [$handler]);
        }

        $formatter = new \GuzzleHttp\MessageFormatter($messageFormat);

        $handler = \GuzzleHttp\Middleware::log($logger, $formatter);
        $this->logger = $handler;

        $handlerStack = $this->getConfig('handler');
        $this->setLogHandler($handlerStack, $handler);

        return $this;
    }
791086
public function setLogger(LoggerInterface $logger)
	{
		$this->logger = $logger;

		// Also update the logger on all current gateways in our pool
		foreach ($this->gatewayPool as $gateway) {
			$gateway->setLogger($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()
        ]);
    }
575341
public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
        $this->getLogger()->info('ClientHandler is started with pid '.getmypid());
    }
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);
        }
    }
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;
    }
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);
        }
    }
538859
public function setLogger(LoggerInterface $logger)
	{
		$this->logger = $logger;

		// Also update the logger of the sender
		if ($this->sender instanceOf LoggerAwareInterface) {
			$this->sender->setLogger($logger);
		}
	}
653606
public function registerLogger(LoggerInterface $logger = null, $debug = false)
    {
        $this->logger = $logger ?: new NullLogger();
        $this->debug = $debug;

        return $this;
    }
1086779
public function setLogger($logger = null)
    {
        if (!isset($logger)) {
            $logger = new \WebPConvert\Loggers\VoidLogger();
        }
        $this->logger = $logger;
    }
1101161
public function register(string $key, LoggerInterface $logger)
    {
        $this->loggers[$key] = $logger;
        $logger->writeHeader();
    }