<commit_before><?php

namespace Gini\Module\Gapper\Client
{
    trait RPCTrait
    {
        private static $_RPCs = [];
        private static function getRPC($type='gapper')
        {
            if (!self::$_RPCs[$type]) {
                try {
                    $config = (array)\Gini\Config::get($type . '.rpc');
                    $api = $config['url'];
                    $client_id = $config['client_id'];
                    $client_secret = $config['client_secret'];
                    $rpc = \Gini\IoC::construct('\Gini\RPC', $api, $type);
                    $bool = $rpc->authorize($client_id, $client_secret);
                    if (!$bool) {
                        throw new \Exception('Your APP was not registered in gapper server!');
                    }
                    self::$_RPCs[$type] = $rpc;
                } catch (\Gini\RPC\Exception $e) {
                }
            }
            return self::$_RPCs[$type];
        }
    }
}
<commit_msg>use logger in RPCTrait<commit_after><?php

namespace Gini\Module\Gapper\Client
{
    trait RPCTrait
    {
        private static $_RPCs = [];
        private static function getRPC($type='gapper')
        {
            if (!self::$_RPCs[$type]) {
                try {
                    $config = (array)\Gini\Config::get($type . '.rpc');
                    $api = $config['url'];
                    $client_id = $config['client_id'];
                    $client_secret = $config['client_secret'];
                    $rpc = \Gini\IoC::construct('\Gini\RPC', $api, $type);
                    $bool = $rpc->authorize($client_id, $client_secret);
                    if (!$bool) {
                        throw new \Exception('Your app was not registered in gapper server!');
                    }
                    self::$_RPCs[$type] = $rpc;
                } catch (\Gini\RPC\Exception $e) {
                    \Gini\Logger::of('gapper')->error('Gapper::getRPC error: {message}', ['message' => $e->getMessage()]);
                }
            }
            return self::$_RPCs[$type];
        }
    }
}

{'fraction_non_alphanumeric': 0.1518624641833811, 'fraction_numerical': 0.0, 'mean_word_length': 1.3806818181818181, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '3510478', 'n_tokens_mistral': 595, 'n_tokens_neox': 570, 'n_words': 108}