RedBeanPHP\Logger\RDefault\Debug::output PHP Method

output() protected method

Depending on the value of constant PHP_SAPI this function will format output for console or HTML.
protected output ( string $str ) : void
$str string string to log or output and log
return void
    protected function output($str)
    {
        $this->logs[] = $str;
        if (!$this->mode) {
            $highlight = FALSE;
            /* just a quick heuritsic to highlight schema changes */
            if (strpos($str, 'CREATE') === 0 || strpos($str, 'ALTER') === 0 || strpos($str, 'DROP') === 0) {
                $highlight = TRUE;
            }
            if (PHP_SAPI === 'cli') {
                if ($highlight) {
                    echo "";
                }
                echo $str, PHP_EOL;
                echo "";
            } else {
                if ($highlight) {
                    echo "<b style=\"color:red\">{$str}</b>";
                } else {
                    echo $str;
                }
                echo '<br />';
            }
        }
    }