Esempio n. 1
0
 /**
  * Default call back for displaying exceptions.
  * @param Exception $exception
  */
 public static function exceptionHandler($exception)
 {
     $class = new \ReflectionObject($exception);
     $logged = utils\Logger::log($exception->getMessage() . "\n" . $exception->getTraceAsString(), "logs/application.log");
     echo Ntentan::error("Exception <code><b>{$class->getName()}</b></code> thrown in " . "<code><b>{$exception->getFile()}</b></code> on line " . "<code><b>{$exception->getLine()}</b></code>. " . $exception->getMessage() . ($logged === false ? "\n\n<p>Failed to log this exception. Please check and ensure " . "that the file [logs/application.log] exists and is " . "writable.</p>" : ""), "Exception <code>" . $class->getName() . "</code> thrown", null, true, $exception->getTrace());
 }
Esempio n. 2
0
 public function query($query)
 {
     $this->lastQuery = $query;
     if (Ntentan::$debug === true) {
         if (is_writeable('logs/queries.log')) {
             Logger::log("[query] {$query}", "logs/queries.log");
         }
     }
     return $this->_query($query);
 }