@param LoggerInterface $logger
@param string          $buildFolder
@param string|null     $file
@param array           $fields
@param string          $format

@return WriterCollection
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;
    }
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;
    }
1267251
public static function getOrCreateFileLogger(string $category, string $logfilePath): LoggerInterface
    {
        $hash = sha1($category . $logfilePath);

        if (!isset(self::$instance[$hash])) {
            $logger = new Logger($category);
            $logger->pushHandler(new StreamHandler($logfilePath, Logger::DEBUG));

            self::$instance[$hash] = $logger;
        }

        return self::$instance[$hash];
    }
727630
public function writer($level, $message)
    {
        (!empty($this->file)) ? $fileName = $this->file : $fileName = '.logs';
        $fileHandling = new FileHandling();
        $text = 'Date/time: '.date('Y-m-d h:i:s A')." , Level: $level , message: ".$message."\n";
        $file = route()->storage->log.$fileName;
        $fileHandling->open($file, 'readWriteAppend')->write($text);
        $fileHandling->close();
    }
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');
        }
    }
949787
public static function createWithBuilder(
        HandlerBuilderInterface $builder,
        FormatterRegistryInterface $formatterRegistry,
        $debug = false
    ) {
        $handler = $builder->buildHandler();
        $docGenerator = new DocGenerator($builder->buildDocExtractor(), $formatterRegistry);

        return new static($handler, $docGenerator, $debug);
    }
150482
public function createLogCollector(LogCollectorSettings $collector)
    {
        $url = self::makeUrl();
        $jsonData = json_encode($collector->jsonSerialize());
        
        $result = $this->service->prepAndSend($url, array(200), "POST", $jsonData, true);
        $resultObject = json_decode($result);
        return LogCollectorSettings::createFromJSON($resultObject);
    }
564895
private static function createLogFile($logDir, $fileName)
    {
        $file = realpath($logDir . DIRECTORY_SEPARATOR . $fileName);
        touch($file);
        return $file;
    }
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;
    }
10746
public static function create(LoggerInterface $logger = null, $configuration = array())
    {
        if (!$configuration instanceof ConfigurationInterface) {
            $configuration = new Configuration($configuration);
        }

        $binaries = $configuration->get('pdftohtml.binaries', 'pdftohtml');

        if (!$configuration->has('timeout')) {
            $configuration->set('timeout', 60);
        }

        try {
            return static::load($binaries, $logger, $configuration);
        } catch (BinaryDriverExecutableNotFound $e) {
            throw new ExecutableNotFoundException('Unable to load pdftohtml', $e->getCode(), $e);
        }
    }
257723
public function buildContentFieldValue(FormBuilderInterface $builder, FieldInterface $field)
    {
        $builder->add('value', $this->getFormFieldType(), array_merge(
            $this->getDefaultFormFieldValueOptions($field),
            $this->getFormFieldValueOptions($field)
        ));

        $modelTransformer = $this->getValueModelTransformer($field);
        if ($modelTransformer !== null) {
            $builder->get('value')
                ->addModelTransformer($modelTransformer);
        }
    }
1257497
public static Builder newBuilder(Class<?> loggingClass) {
    if (loggingClass == null) throw new NullPointerException("loggingClass == null");
    return new Builder(Logger.getLogger(loggingClass.getName()));
  }
582556
public function parse($filename, ProjectDescriptorBuilder $builder)
    {
        if (class_exists('phpDocumentor\Event\Dispatcher')) {
            Dispatcher::getInstance()->dispatch(
                'parser.file.pre',
                PreFileEvent::createInstance($this)->setFile($filename)
            );
        }
        $this->log('Starting to parse file: ' . $filename);

        try {
            $file = $this->createFileReflector($builder, $filename);
            if (!$file) {
                $this->log('>> Skipped file ' . $filename . ' as no modifications were detected');
                return;
            }

            $file->process();
            $builder->buildFileUsingSourceData($file);
            $this->logErrorsForDescriptor($builder->getProjectDescriptor()->getFiles()->get($file->getFilename()));
        } catch (Exception $e) {
            $this->log(
                '  Unable to parse file "' . $filename . '", an error was detected: ' . $e->getMessage(),
                LogLevel::ALERT
            );
        }
    }
740084
public function getBulkWriteBuilder(DocumentManager $documentManager, string $collectionName)
    {
        if (!array_key_exists($collectionName, $this->builders)) {
            $this->builders[$collectionName] = new BulkWriteBuilder($documentManager, $collectionName);
        }

        return $this->builders[$collectionName];
    }
766841
public static function log($data, $fileName = 'log', $ext='txt', $format='Ymd') {
        $filePath = Config::getx('path_temp') . 'logs'. DIRECTORY_SEPARATOR;
        if (!is_dir($filePath)) {
            if(!mkdir($filePath,0755,true)){
                throw new \Exception('Create log dir is fail!');
            }
        }
        $message = '[' . date("Y-m-d h:i:s") . ']  ';
        if($data instanceof \Throwable) {
            $message .= $data->getMessage().' in '.$data->getFile().':'.$data->getLine();
        }
        else {
            $message .= (is_array($data) ? print_r($data, true) : $data);
        }
        $message .="\n";
        $format = date($format);
        $fileName = "{$filePath}{$fileName}_{$format}.{$ext}";
        error_log($message, 3, $fileName);
    }
1125078
public function buildForm(FormBuilderInterface $builder, array $options)
	{
		$builder->add('title', TextType::class, array(
			'label' => 'Post title',
			'required' => true,
			'attr' => array('class' => 'doc-title')
		))
		->add('slug', TextType::class, array(
			'label' => 'Slug',
			'required' => true,
			'attr' => array('class' => 'doc-slug')
		))
		->add('state', ChoiceType::class, array(
			'label' => 'State',
			'required' => true,
			'choices' => array(
				'Draft' => DocumentModel::STATE_DRAFT, 
				'Waiting' => DocumentModel::STATE_WAITING, 
				'Published' => DocumentModel::STATE_PUBLISHED
			),
			'preferred_choices' => array(DocumentModel::STATE_DRAFT)
		))
		->add('content', TextareaType::class, array(
			'label' => 'Content',
			'required' => false,
			'attr' => array('class' => 'tinymce-content doc-content')
		));
	}
710508
public function export(Logger $logger = null)
    {
        foreach ($this->site->process() as $path => $content)
        {
            $dest = "{$this->path}/$path";
            $folder = substr($dest, 0, strrpos($dest, '/'));
            
            if (!is_dir($folder)) 
            {
                mkdir($folder, 0777, true);
            }
            
            if (file_put_contents($dest, $content['output']) && $logger)
            {
                $logger->log(Logger::INFO, 'Web page %s was compiled at %s', [$path, $dest]);
            }
        }
        
        return true;
    }