<?php

namespace apexl\Utils\Debug;

class ErrorLog
{
    public static function pretty($var, $logToApache = true)
    {
        ob_start();
        echo '<pre class=\'prettyprint\'>';
        print_r($var);
        echo '</pre>';
        $log = ob_get_contents();
        ob_clean();
        if ($logToApache) {
            error_log($log);
        }
        return $log;
    }
}
