<commit_before><?php

namespace Nip\DebugBar;

use DebugBar\DataCollector\ExceptionsCollector;
use DebugBar\DataCollector\MemoryCollector;
use DebugBar\DataCollector\MessagesCollector;
use DebugBar\DataCollector\PhpInfoCollector;
use DebugBar\DataCollector\RequestDataCollector;
use DebugBar\DataCollector\TimeDataCollector;
use Nip\DebugBar\DataCollector\QueryCollector;
use Nip\DebugBar\DataCollector\RouteCollector;

//use DebugBar\DataCollector\ConfigCollector;

/**
 * Class StandardDebugBar
 * @package Nip\DebugBar
 */
class StandardDebugBar extends DebugBar
{


    public function doBoot()
    {
        $this->addCollector(new PhpInfoCollector());
        $this->addCollector(new MessagesCollector());
        $this->addCollector(new RequestDataCollector());
        $this->addCollector(new TimeDataCollector());
        $this->addCollector(new MemoryCollector());
        $this->addCollector(new ExceptionsCollector());
        $this->addCollector(new QueryCollector());
        $this->addCollector(new RouteCollector());
    }

    /**
     * @param $adapter
     */
    public function initDatabaseAdapter($adapter)
    {
        $profiler = $adapter->newProfiler()->setEnabled(true);
        $writer = $profiler->newWriter('DebugBar');

        /** @var ProfilerDebugBar $writer */
        $writer->setCollector($this->getCollector('queries'));
        $profiler->addWriter($writer);
        $adapter->setProfiler($profiler);
    }
}<commit_msg>add monolog to DebugBar<commit_after><?php

namespace Nip\DebugBar;

use DebugBar\DataCollector\ExceptionsCollector;
use DebugBar\DataCollector\MemoryCollector;
use DebugBar\DataCollector\MessagesCollector;
use DebugBar\DataCollector\PhpInfoCollector;
use DebugBar\DataCollector\RequestDataCollector;
use DebugBar\DataCollector\TimeDataCollector;
use Monolog\Logger as Monolog;
use Nip\DebugBar\DataCollector\QueryCollector;
use Nip\DebugBar\DataCollector\RouteCollector;

//use DebugBar\DataCollector\ConfigCollector;

/**
 * Class StandardDebugBar
 * @package Nip\DebugBar
 */
class StandardDebugBar extends DebugBar
{


    public function doBoot()
    {
        $this->addCollector(new PhpInfoCollector());
        $this->addCollector(new MessagesCollector());
        $this->addCollector(new RequestDataCollector());
        $this->addCollector(new TimeDataCollector());
        $this->addCollector(new MemoryCollector());
        $this->addCollector(new QueryCollector());
        $this->addCollector(new RouteCollector());

        if (app()->has(Monolog::class)) {
            $monolog = app(Monolog::class);
            $this->addCollector(new \DebugBar\Bridge\MonologCollector($monolog));
        } else {
            $this->addCollector(new ExceptionsCollector());
        }
    }

    /**
     * @param $adapter
     */
    public function initDatabaseAdapter($adapter)
    {
        $profiler = $adapter->newProfiler()->setEnabled(true);
        $writer = $profiler->newWriter('DebugBar');

        /** @var ProfilerDebugBar $writer */
        $writer->setCollector($this->getCollector('queries'));
        $profiler->addWriter($writer);
        $adapter->setProfiler($profiler);
    }
}
{'fraction_non_alphanumeric': 0.12883823994935106, 'fraction_numerical': 0.0, 'mean_word_length': 3.869029275808937, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2211204', 'n_tokens_mistral': 939, 'n_tokens_neox': 943, 'n_words': 140}