DboSource::showLog PHP Method

showLog() public method

Outputs the contents of the queries log. If in a non-CLI environment the sql_log element will be rendered and output. If in a CLI environment, a plain text log is generated.
public showLog ( boolean $sorted = false ) : void
$sorted boolean Get the queries sorted by time taken, defaults to false.
return void
    public function showLog($sorted = false)
    {
        $log = $this->getLog($sorted, false);
        if (empty($log['log'])) {
            return;
        }
        if (PHP_SAPI !== 'cli') {
            $controller = null;
            $View = new View($controller, false);
            $View->set('sqlLogs', array($this->configKeyName => $log));
            echo $View->element('sql_dump', array('_forced_from_dbo_' => true));
        } else {
            foreach ($log['log'] as $k => $i) {
                print $k + 1 . ". {$i['query']}\n";
            }
        }
    }
DboSource