Sends a debug info to the handler

@param string $query
@param float $duration
@param mixed $info
12508
protected function debugLog($query, $duration, $info)
    {
        if ($this->debugCallback) {
            call_user_func($this->debugCallback, $query, $duration, $info);
        }
    }
954901
private function debugQuery(QueryDebugger $queryDebugger = null)
    {
        if ($queryDebugger === null) {
            return;
        }

        $queryDebugger->stop();

        $this->getConfiguration()->getEventDispatcher()->dispatch(
            Events::QUERY_DEBUG,
            new QueryDebugEvent($queryDebugger)
        );
    }
195563
public function statements(string $query)
    {
        try {
            $this->pdo->exec($query);
        } catch (\Throwable $exception) {
            throw static::wrapException($exception, $query);
        }
    }
179343
public function display($info = null, $details = null, $origin = null, $time = null)
    {
        if (!$this->hasCommand()) {
            return;
        }

        // Build handle
        $comment = $this->getTree().$this->getFork();

        // Add details
        if ($info) {
            $comment .= ' <info>'.$info.'</info>';
        }
        if ($details) {
            $comment .= ' <comment>('.$details.')</comment>';
        }
        if ($origin) {
            $comment .= ' fired by <info>'.$origin.'</info>';
        }
        if ($time) {
            $comment .= ' [~'.$time.'s]';
        }

        $this->command->writeln($comment);
    }
919274
public function query($query, array $binds = array())
    {
        //Argument 1 must be a string or null
        Argument::i()->test(1, 'string', self::QUERY);
        
        $request = new \stdClass();
        
        $request->query = $query;
        $request->binds = $binds;
        
        //event trigger
        $this->trigger('sql-query-before', $request);
        
        $connection = $this->getConnection();
        $query      = (string) $request->query;
        $stmt       = $connection->prepare($query);
        
        //bind some more values
        foreach ($request->binds as $key => $value) {
            $stmt->bindValue($key, $value);
        }
        
        //PDO Execute
        if (!$stmt->execute()) {
            $error = $stmt->errorInfo();
            
            //unpack binds for the report
            foreach ($binds as $key => $value) {
                $query = str_replace($key, "'$value'", $query);
            }
            
            //throw Exception
            Exception::i()
                ->setMessage(Exception::QUERY_ERROR)
                ->addVariable($query)
                ->addVariable($error[2])
                ->trigger();
        }
        
        $results = $stmt->fetchAll(\PDO::FETCH_ASSOC);
        
        if($this->queryCache) {
            //log query
            $this->queries[] = array(
                'query'     => $query,
                'binds'     => $binds,
                'results'   => $results);
        }

        //clear binds
        $this->binds = array();
        
        //event trigger
        $this->trigger('sql-query-after', $query, $binds, $results);
        
        return $results;
    }
35697
private function doDeleteOrUpdate($query, $params, $sqlPrefix, $handler)
    {
        $this->_testQueryStarts($query, $sqlPrefix);

        if ($handler !== null)
            call_user_func_array($handler, [$query, $params]);

        $statement = $this->_executeQuery($query, $params);
        return $statement->rowCount();
    }
22130
public void debug(Object message, Throwable t) {
        differentiatedLog(null, CATEGORY_FQCN, LocationAwareLogger.DEBUG_INT, message, t);
    }
1192862
protected function handle($query, $target, $source = null, $plainText = false)
    {
        if (null === $source) {
            $source = $this->getDetector()->detect($query);
        }

        // Split up the query if it is too long. See MAXIMUM_TEXT_SIZE description for more info.
        {
            $queryArray = [];
            $remainingQuery = $query;
            while (strlen($remainingQuery) >= self::MAXIMUM_TEXT_SIZE) {
                // Get closest breaking character, but not farther than MAXIMUM_TEXT_SIZE characters away.
                $i = 0;
                $find = ["\n", '.', ' '];

                while (false === ($pos = strrpos($remainingQuery, $find[$i], -(strlen($remainingQuery) - self::MAXIMUM_TEXT_SIZE)))) {
                    $i++;
                    if ($i >= count($find)) {
                        break;
                    }
                }
                if (false === $pos || 0 === $pos) {
                    break;
                }

                // Split.
                $queryArray[] = substr($remainingQuery, 0, $pos);
                $remainingQuery = substr($remainingQuery, $pos);
            }
            $queryArray[] = $remainingQuery;
        }

        // Translate piece by piece.
        $result = '';
        foreach ($queryArray as $subQuery) {
            $options = [
                'key'    => $this->apiKey,
                'q'      => $subQuery,
                'source' => $source,
                'target' => $target,
                'format' => ($plainText ? 'text' : 'html'),
            ];

            $result .= $this->process($options);
        }

        return $result;
    }
1258811
protected function retryQuery($query, array $params = [])
    {
        $liteAttempts = $mainAttempts = 0;
        $liteRetryCount = (int)(getenv('DB_LITE_RETRY_COUNT') ?: static::LITE_RETRY_COUNT);
        $retryTimeout = (int)(getenv('DB_RETRY_TIMEOUT') ?: static::RETRY_TIMEOUT);
        $mainRetryCount = (int)(getenv('DB_MAIN_RETRY_COUNT') ?: static::MAIN_RETRY_COUNT);
        do {
            try {
                return parent::query($query, $params);
            } catch (\PDOException $e) {
                switch (substr($e->getCode(), 0, 2)) {
                    case '0Z':
                    case '2D':
                    case '3B':
                        $liteAttempts++;
                        if ($liteAttempts <= $liteRetryCount) {
                            usleep($retryTimeout);
                            continue 2;
                        }
                        break;
                    case '40':
                    case '55':
                        $mainAttempts++;
                        if ($mainAttempts <= $mainRetryCount) {
                            usleep($retryTimeout);
                            continue 2;
                        }
                }
            }

            throw $e;
        } while(true);
    }
508065
protected function _logQuery(Query $query, LoggerInterface $logger)
    {
        if (!$this->getDriver()->isQueryLoggingEnabled()) {
            return;
        }

        $logger->debug($query->endpoint(), [
            'params' => $query->where()
        ]);
    }
692327
private static void logWarn(final AbstractHttpQuery query, final String msg) {
    LOG.warn(query.channel().toString() + ' ' + msg);
  }
1159324
public function logCommand($command, $duration, $connection, $error = false)
    {
        ++$this->nbCommands;

        if (null !== $this->logger) {
            $this->commands[] = array('cmd' => $command, 'executionMS' => $duration, 'conn' => $connection, 'error' => $error);
            if ($error) {
                $message = 'Command "' . $command . '" failed (' . $error . ')';

                $this->logger->error($message);
            } else {
                $this->logger->debug('Executing command "' . $command . '"');
            }
        }
    }
173433
def set_debug(self, status):
        """"""
        if status:
            self.logger.setLevel('DEBUG')
        else:
            self.logger.setLevel('INFO')
409932
public function debugInfo($info)
    {
        if ($this->debug_mode && (is_object($this->debugger) && ($this->debugger instanceof \Closure))) {
            list(, $caller) = debug_backtrace(false);

            $caller_function = $caller['function'];
            $caller_class    = $caller['class'];

            $this->debugger->__invoke($caller_class.'::'.$caller_function.' > '.$info);
        }
    }
324546
public function debug()
    {
        $query = $this->pdo->prepare(<<<SQL
SELECT *
FROM robotstxt__cache1
WHERE base = :base;
SQL
        );
        $query->bindValue('base', $this->base, \PDO::PARAM_STR);
        $query->execute();
        return $query->rowCount() > 0 ? $query->fetch(\PDO::FETCH_ASSOC) : [];
    }
37361
private function send($type, array $query)
    {

        $client = new Client([
            'base_uri' => 'https://www.google-analytics.com/',
            'timeout'  => 5.0,
        ]);

        // Check if we are in debug mode
        $uri = $this->debug ? '/debug/collect' : '/collect';

        // Submit the hit
        $client->get($uri, [
            'query' => array_merge([

                // Fields referenced from:
                //  https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters

                // Required Fields
                //  https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#required
                'v'   => 1,                     // Protocol Version
                'tid' => $this->tracking_id,    // Google Tracking-ID
                'cid' => $this->getClientID(),  // Unique Client-ID
                't'   => $type,                 // Event

                // Optional Fields
                'aip' => 1,                     // Anonymize the IP of the calling client
                'an'  => 'SeAT',                // App Name

                // Versions of the currently installed packages.
                'av'  => 'api/' . config('api.config.version') . ', ' .
                    'console/' . config('console.config.version') . ', ' .
                    'eveapi/' . config('eveapi.config.version') . ', ' .
                    'notifications/' . config('notifications.config.version') . ', ' .
                    'web/' . config('web.config.version') . ', ' .
                    'services/' . config('services.config.version') . ', ',

                // User Agent is comprised of OS Name(s), Release(r)
                // and Machine Type(m). Examples:
                //  Darwin/15.6.0/x86_64
                //  Linux/2.6.32-642.el6.x86_64/x86_64
                //
                // See:
                //  http://php.net/manual/en/function.php-uname.php
                'ua'  => 'SeAT/' . php_uname('s') .
                    '/' . php_uname('r') .
                    '/' . php_uname('m'),

                'z' => rand(1, 10000),          // Cache Busting Random Value
            ], $query),
        ]);

    }
686002
public function debug_handler(&$smtp, $message)
    {
        // catch AUTH commands and set anonymization flag for subsequent sends
        if (preg_match('/^Send: AUTH ([A-Z]+)/', $message, $m)) {
            $this->anonymize_log = $m[1] == 'LOGIN' ? 2 : 1;
        }
        // anonymize this log entry
        else if ($this->anonymize_log > 0 && strpos($message, 'Send:') === 0 && --$this->anonymize_log == 0) {
            $message = sprintf('Send: ****** [%d]', strlen($message) - 8);
        }

        if (($len = strlen($message)) > self::DEBUG_LINE_LENGTH) {
            $diff    = $len - self::DEBUG_LINE_LENGTH;
            $message = substr($message, 0, self::DEBUG_LINE_LENGTH)
                . "... [truncated $diff bytes]";
        }

        rcube::write_log('smtp', preg_replace('/\r\n$/', '', $message));
    }