@param LoggerInterface $logger
@param string          $buildFolder

@return WriterCollection
504456
public function createCollection(LoggerInterface $logger, string $buildFolder) : WriterCollection
    {
        $writerCollection = new WriterCollection();
        $propertyHolder   = new PropertyHolder();

        $fullFilter = new FullFilter($propertyHolder);
        $stdFilter  = new StandardFilter($propertyHolder);
        $liteFilter = new LiteFilter($propertyHolder);

        $aspFormatter  = new AspFormatter($propertyHolder);
        $phpFormatter  = new PhpFormatter($propertyHolder);
        $csvFormatter  = new CsvFormatter($propertyHolder);
        $xmlFormatter  = new XmlFormatter($propertyHolder);
        $jsonFormatter = new JsonFormatter($propertyHolder);

        $fullAspWriter = new IniWriter($buildFolder . '/full_asp_browscap.ini', $logger);
        $fullAspWriter->setFormatter($aspFormatter);
        $fullAspWriter->setFilter($fullFilter);
        $writerCollection->addWriter($fullAspWriter);

        $fullPhpWriter = new IniWriter($buildFolder . '/full_php_browscap.ini', $logger);
        $fullPhpWriter->setFormatter($phpFormatter);
        $fullPhpWriter->setFilter($fullFilter);
        $writerCollection->addWriter($fullPhpWriter);

        $stdAspWriter = new IniWriter($buildFolder . '/browscap.ini', $logger);
        $stdAspWriter->setFormatter($aspFormatter);
        $stdAspWriter->setFilter($stdFilter);
        $writerCollection->addWriter($stdAspWriter);

        $stdPhpWriter = new IniWriter($buildFolder . '/php_browscap.ini', $logger);
        $stdPhpWriter->setFormatter($phpFormatter);
        $stdPhpWriter->setFilter($stdFilter);
        $writerCollection->addWriter($stdPhpWriter);

        $liteAspWriter = new IniWriter($buildFolder . '/lite_asp_browscap.ini', $logger);
        $liteAspWriter->setFormatter($aspFormatter);
        $liteAspWriter->setFilter($liteFilter);
        $writerCollection->addWriter($liteAspWriter);

        $litePhpWriter = new IniWriter($buildFolder . '/lite_php_browscap.ini', $logger);
        $litePhpWriter->setFormatter($phpFormatter);
        $litePhpWriter->setFilter($liteFilter);
        $writerCollection->addWriter($litePhpWriter);

        $csvWriter = new CsvWriter($buildFolder . '/browscap.csv', $logger);
        $csvWriter->setFormatter($csvFormatter);
        $csvWriter->setFilter($fullFilter);
        $writerCollection->addWriter($csvWriter);

        $xmlWriter = new XmlWriter($buildFolder . '/browscap.xml', $logger);
        $xmlWriter->setFormatter($xmlFormatter);
        $xmlWriter->setFilter($stdFilter);
        $writerCollection->addWriter($xmlWriter);

        $jsonWriter = new JsonWriter($buildFolder . '/browscap.json', $logger);
        $jsonWriter->setFormatter($jsonFormatter);
        $jsonWriter->setFilter($fullFilter);
        $writerCollection->addWriter($jsonWriter);

        $liteJsonWriter = new JsonWriter($buildFolder . '/lite_browscap.json', $logger);
        $liteJsonWriter->setFormatter($jsonFormatter);
        $liteJsonWriter->setFilter($liteFilter);
        $writerCollection->addWriter($liteJsonWriter);

        return $writerCollection;
    }
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;
	}
354583
public static function getLogger($loggerType, $loggerParams = array()) {
        //trap all possible exceptions and throw LoggerException
        try {
            switch ($loggerType) {
                case LOGGER_STDERR:
                    return self::_getLoggerStderr();
                case LOGGER_LEVEL1:
                    return self::_getLoggerLevel1($loggerParams);
                case LOGGER_LEVEL2:
                    return self::_getLoggerLevel2($loggerParams);                
                case LOGGER_LEVEL3:
                    return self::_getLoggerLevel3($loggerParams);              
                case LOGGER_SECURITY:
                    return self::_getLoggerSecurity($loggerParams);
            }            
        } catch (\Exception $logException) {
            throw new LoggerException('Logger caught an exception in '
                . $logException->getTraceAsString() . ':'
                . $logException->getMessage(), 1001);
        }
    }
1014066
public function log(LoggerInterface $logger, array $context = [])
    {
        $this->addContext($context);
        $logger->log($this->getLevel(), $this->getMessage(), $this->getContext());

        return $this;
    }
377137
public static function log(
        LoggerInterface $logger,
        GuzzleLogMessageFormatter $messageFormatter
    ) {
        return function (callable $handler) use ($logger, $messageFormatter) {
            return function ($request, array $options) use ($handler, $logger, $messageFormatter) {
                return $handler($request, $options)->then(

                    function ($response) use ($request, $logger, $messageFormatter) {
                        // Logs messages in case of successful HTTP calls.
                        $logger->info(
                            $messageFormatter->formatSummary($request, $response)
                        );

                        // formatDetailed() can produce long log messages
                        // so check if it handles DEBUG level when possible.
                        if (!($logger instanceof Logger)
                            || $logger->isHandling(Logger::DEBUG)) {
                            $logger->debug($messageFormatter->formatDetailed(
                                $request,
                                $response
                            ));
                        }

                        return $response;
                    },
                    function ($reason) use ($request, $logger, $messageFormatter) {
                        // Logs messages in case of failing HTTP calls.
                        $response = is_subclass_of(
                            $reason,
                            'GuzzleHttp\Exception\RequestException'
                        ) ? $reason->getResponse() : null;

                        $logger->warning(
                            $messageFormatter->formatSummary($request, $response)
                        );

                        // formatDetailed() can produce long log messages
                        // so check if it handles NOTICE level when
                        // possible.
                        if (!($logger instanceof Logger)
                            || $logger->isHandling(Logger::NOTICE)) {
                            $logger->notice($messageFormatter->formatDetailed(
                                $request,
                                $response,
                                $reason
                            ));
                        }

                        return \GuzzleHttp\Promise\rejection_for($reason);
                    }
                );
            };
        };
    }
983210
public static function create($connectionConfigs, LoggerInterface $logger = null) {
        if (!is_null(self::$instance)) {
            throw new SqlException('ConnectionManager实例已创建，不能重复创建~');
        }

        self::$instance = new ConnectionManager($connectionConfigs, $logger);
        return self::$instance;
    }
379205
public function setLogger($logger)
    {
        $this->logger = $logger;
        $this->connection->getConfiguration()->setSQLLogger($this->logger);
        return $this;
    }
782867
public function setLogger( LoggerInterface $logger ) {
		$this->logger = $logger;
		$this->session->setLogger( $logger );
	}
422159
public function setLogger(LoggerInterface $logger)
    {
        if (!$logger instanceof SplObserver) {
            throw new Doozr_Logging_Exception(
                sprintf('Please implement SplObserver before trying to attach your logging.')
            );
        }

        $this->attach($logger);

        return null;
    }
564895
private static function createLogFile($logDir, $fileName)
    {
        $file = realpath($logDir . DIRECTORY_SEPARATOR . $fileName);
        touch($file);
        return $file;
    }
71984
public function setLogsDir(string $logsDir): void
    {
        if (!file_exists($logsDir) || !is_writable($logsDir)) {
            throw new LoggerException('Logs path does not exist or is not writable.');
        }
        $this->logsDir = rtrim($logsDir, '/') . '/';
    }
619747
public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;

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

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

        return $this;
    }
1029235
public function buildLogger($class, Configurator $configurator)
    {
        if (!class_exists($class) || !is_subclass_of($class, Logger::class)) {
            $class = "\\Phassets\\Loggers\\$class";
        }

        if (class_exists($class) && is_subclass_of($class, Logger::class)) {
            return new $class($configurator);
        }

        return false;
    }
553709
public function createCollection(
        LoggerInterface $logger,
        string $buildFolder,
        ?string $file = null,
        array $fields = [],
        string $format = FormatterInterface::TYPE_PHP
    ) : WriterCollection {
        $writerCollection = new WriterCollection();
        $propertyHolder   = new PropertyHolder();

        if (null === $file) {
            switch ($format) {
                case FormatterInterface::TYPE_ASP:
                    $file = $buildFolder . '/full_browscap.ini';

                    break;
                case FormatterInterface::TYPE_CSV:
                    $file = $buildFolder . '/browscap.csv';

                    break;
                case FormatterInterface::TYPE_XML:
                    $file = $buildFolder . '/browscap.xml';

                    break;
                case FormatterInterface::TYPE_JSON:
                    $file = $buildFolder . '/browscap.json';

                    break;
                case FormatterInterface::TYPE_PHP:
                default:
                    $file = $buildFolder . '/full_php_browscap.ini';

                    break;
            }
        }

        $filter = new CustomFilter($propertyHolder, $fields);

        switch ($format) {
            case FormatterInterface::TYPE_ASP:
                $writer    = new Writer\IniWriter($file, $logger);
                $formatter = new Formatter\AspFormatter($propertyHolder);

                break;
            case FormatterInterface::TYPE_CSV:
                $writer    = new Writer\CsvWriter($file, $logger);
                $formatter = new Formatter\CsvFormatter($propertyHolder);

                break;
            case FormatterInterface::TYPE_XML:
                $writer    = new Writer\XmlWriter($file, $logger);
                $formatter = new Formatter\XmlFormatter($propertyHolder);

                break;
            case FormatterInterface::TYPE_JSON:
                $writer    = new Writer\JsonWriter($file, $logger);
                $formatter = new Formatter\JsonFormatter($propertyHolder);

                break;
            case FormatterInterface::TYPE_PHP:
            default:
                $writer    = new Writer\IniWriter($file, $logger);
                $formatter = new Formatter\PhpFormatter($propertyHolder);

                break;
        }

        $writer->setFormatter($formatter);
        $writer->setFilter($filter);

        $writerCollection->addWriter($writer);

        return $writerCollection;
    }
1257497
public static Builder newBuilder(Class<?> loggingClass) {
    if (loggingClass == null) throw new NullPointerException("loggingClass == null");
    return new Builder(Logger.getLogger(loggingClass.getName()));
  }
161365
public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
        $this->extractor->setLogger($logger);
        $this->httpClient->setLogger($logger);
    }
1254138
public function addWriter($level, LoggerInterface $strategy)
    {
        switch ($level) {
            default:
                throw new \InvalidArgumentException('Invalid $level');
            case LogLevel::DEBUG:
                $this->writers[LogLevel::DEBUG][] = $strategy;
            case LogLevel::INFO:
                $this->writers[LogLevel::INFO][] = $strategy;
            case LogLevel::NOTICE:
                $this->writers[LogLevel::NOTICE][] = $strategy;
            case LogLevel::WARNING:
                $this->writers[LogLevel::WARNING][] = $strategy;
            case LogLevel::ERROR:
                $this->writers[LogLevel::ERROR][] = $strategy;
            case LogLevel::CRITICAL:
                $this->writers[LogLevel::CRITICAL][] = $strategy;
            case LogLevel::ALERT:
                $this->writers[LogLevel::ALERT][] = $strategy;
            case LogLevel::EMERGENCY:
                $this->writers[LogLevel::EMERGENCY][] = $strategy;
        }
    }