/**
  * @return CL_Error
  */
 public static function get_instance()
 {
     if (self::$instance === NULL) {
         self::$instance = new CL_Error();
     }
     return self::$instance;
 }
function show_error($message, $header = 'error', $type = 'default')
{
    if ($header == 'error') {
        $trace = debug_backtrace();
        if (count($trace) > 1 && key_exists('function', $trace[1]) && key_exists('class', $trace[1])) {
            $header = $trace[1]['class'] . '::' . $trace[1]['function'];
        }
    }
    $err = CL_Error::get_instance();
    if (key_exists('ajax', $_GET)) {
        echo $err->show_ajax_error($message, $type);
    } else {
        echo $err->show_error($message, $header, $type);
    }
    log_message($message);
    exit(-1);
}