<commit_before>#!/usr/bin/env php
<?php

/*
 * This file is part of Jupyter-PHP.
 *
 * (c) 2015-2017 Litipk
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Litipk\JupyterPHP;


require (__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php');


use Litipk\JupyterPHP\System\System;
use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
use Monolog\Handler\FingersCrossedHandler;
use Monolog\Handler\GroupHandler;
use Monolog\Handler\RotatingFileHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogHandler;
use Monolog\Logger;
use Ramsey\Uuid\Uuid;


$system = System::getSystem();
$logger = new Logger('kernel');

$loggerActivationStrategy = new ErrorLevelActivationStrategy(LoggerSettings::getCrossFingersLevel());

if ('root' === $system->getCurrentUser()) {
    if (System::OS_LINUX === $system->getOperativeSystem()) {
        $logger->pushHandler(
            new FingersCrossedHandler(
                new GroupHandler([
                    new SyslogHandler('jupyter-php'),
                    new StreamHandler('php://stderr')
                ]),
                $loggerActivationStrategy,
                128
            )
        );
    }
} else {
    $system->ensurePath($system->getAppDataDirectory().'/logs');
    $logger->pushHandler(new FingersCrossedHandler(
        new GroupHandler([
            new RotatingFileHandler($system->getAppDataDirectory().'/logs/error.log', 7),
            new StreamHandler('php://stderr')
        ]),
        $loggerActivationStrategy,
        128
    ));
}


try {
    // Obtain settings
    $connectionSettings = ConnectionSettings::get();
    $connUris = ConnectionSettings::getConnectionUris($connectionSettings);

    $kernelCore = new KernelCore(
        new JupyterBroker(
            $connectionSettings['key'],
            $connectionSettings['signature_scheme'],
            Uuid::uuid4(),
            $logger->withName('JupyterBroker')
        ),<commit_msg>Added debug message in src/kernel.php<commit_after>#!/usr/bin/env php
<?php

/*
 * This file is part of Jupyter-PHP.
 *
 * (c) 2015-2017 Litipk
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Litipk\JupyterPHP;


require (__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php');


use Litipk\JupyterPHP\System\System;
use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
use Monolog\Handler\FingersCrossedHandler;
use Monolog\Handler\GroupHandler;
use Monolog\Handler\RotatingFileHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogHandler;
use Monolog\Logger;
use Ramsey\Uuid\Uuid;


$system = System::getSystem();
$logger = new Logger('kernel');

$loggerActivationStrategy = new ErrorLevelActivationStrategy(LoggerSettings::getCrossFingersLevel());

if ('root' === $system->getCurrentUser()) {
    if (System::OS_LINUX === $system->getOperativeSystem()) {
        $logger->pushHandler(
            new FingersCrossedHandler(
                new GroupHandler([
                    new SyslogHandler('jupyter-php'),
                    new StreamHandler('php://stderr')
                ]),
                $loggerActivationStrategy,
                128
            )
        );
    }
} else {
    $system->ensurePath($system->getAppDataDirectory().'/logs');
    $logger->pushHandler(new FingersCrossedHandler(
        new GroupHandler([
            new RotatingFileHandler($system->getAppDataDirectory().'/logs/error.log', 7),
            new StreamHandler('php://stderr')
        ]),
        $loggerActivationStrategy,
        128
    ));
}


try {
    // Obtain settings
    $connectionSettings = ConnectionSettings::get();
    $connUris = ConnectionSettings::getConnectionUris($connectionSettings);

    $logger->debug('Connection settings', [
        'processId' => getmypid(),
        'connSettings' => $connectionSettings,
        'connUris' => $connUris
    ]);

    $kernelCore = new KernelCore(
        new JupyterBroker(
            $connectionSettings['key'],
            $connectionSettings['signature_scheme'],
            Uuid::uuid4(),
            $logger->withName('JupyterBroker')
        ),
{'fraction_non_alphanumeric': 0.12445564978225991, 'fraction_numerical': 0.007334402933761174, 'mean_word_length': 3.025830258302583, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '2076346', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1236, 'n_words': 226}