@param Expectation     $expectation
@param LoggerInterface $logger

@throws \RuntimeException
349008
protected function validateScenarioNameOrThrowException(
        Expectation $expectation,
        LoggerInterface $logger
    ) {
        if (!$expectation->getScenarioName()
            && ($expectation->getScenarioStateIs() || $expectation->getNewScenarioState())
        ) {
            $logger->error('Scenario name related misconfiguration');
            throw new \RuntimeException(
                'Expecting or trying to set scenario state without specifying scenario name'
            );
        }
    }
818096
private function initialize_logger( Logger $logger ) {

		$default_handler = $this->use_default_handler( $logger );
		$default_handler and $logger = $logger->pushHandler( $default_handler );

		$default_processor = $this->use_default_processor( $logger );
		$default_processor and $logger = $logger->pushProcessor( $default_processor );

		/**
		 * Fires right before a logger is used for the first time.
		 *
		 * Hook here to set up the logger (e.g., add handlers or processors).
		 *
		 * @param Logger             $logger
		 * @param HandlersRegistry   $handlers_registry
		 * @param ProcessorsRegistry $processors_registry
		 */
		do_action( self::ACTION_LOGGER, $logger, $this->handlers_registry, $this->processors_registry );

		return $logger;
	}
637889
public function error($msg, \Exception $e = null) {
		foreach($this->loggers as $logger)
			$logger->error($msg, $e);
	}
171760
public function assertHasHeader(string $expected)
    {
        $actual = $this->getHeaderText();
        if ($expected === $actual) {
            return;
        }

        throw new ExpectationException(
            sprintf(
                '[W402] Expected screen header "%1$s", found "%2$s".',
                $expected,
                $actual
            ),
            $this->getDriver()
        );
    }
283473
public function setLogger($logger = null)
    {

        if ($logger instanceOf \sb\Logger\Base) {
            $this->logger = $logger;
        } else {
            $this->logger = new \sb\Logger\FileSystem();
        }
    }
1096332
public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
        $this->getClient()->setLogger($logger);
    }
99560
public static function log(LoggerInterface $logger = null, $message, $context = [])
    {
        if ($logger) {
            $logger->warning($message, $context);
        } else {
            $replace = [];
            foreach ($context as $k => $v) {
                if (is_scalar($v)) {
                    $replace['{'.$k.'}'] = $v;
                }
            }
            @trigger_error(strtr($message, $replace), E_USER_WARNING);
        }
    }
1128251
public void setLogger(Logger logger) {
		this.logger = logger == null ? LoggerFactory.getLogger(getClass()) : logger;
	}
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();
    }
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'));
    }
1283166
public static void log(Logger logger, SQLException e) {
    SQLException next = e.getNextException();
    while (next != null) {
      logger.error("SQL error: {}. Message: {}", next.getSQLState(), next.getMessage());
      next = next.getNextException();
    }
  }
927602
private function logMessage(
        LoggerInterface $logger,
        string $level,
        string $value
    ) {
        /**
         * Logs content, using specified level.
         */
        $logger->$level($value);
    }
758408
public function createResponse(
        MockConfig $expectation,
        ResponseInterface $transactionData,
        ServerRequestInterface $request
    ) {
        $url = $expectation->getProxyTo();
        $this->logger->debug('Proxying request to : ' . $url);
        $this->processScenario($expectation);
        $this->processDelay($expectation->getResponse());

        return $this->httpService->send(
            $request->withUri(new Uri($url))
        );
    }
1348968
public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
        $this->factory->setLogger($logger);
        return $this;
    }
328998
protected function buildQueryCallback(LogManager $logger): callable
    {
        return function (QueryExecuted $query) use ($logger) {
            $sql = Str::replaceArray('?', $query->connection->prepareBindings($query->bindings), $query->sql);

            $logger->info("<comment>{$sql} [{$query->time}ms]</comment>");
        };
    }
575341
public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
        $this->getLogger()->info('ClientHandler is started with pid '.getmypid());
    }