コード例 #1
0
ファイル: Slim.php プロジェクト: ntdt/Slim
 /**
  * Handle exceptions
  *
  * This is the global Exception handler that will catch uncaught exceptions
  * and display a nice-looking page with details about the exception.
  *
  * @param   Exception $e
  * @return  void
  */
 public static function handleExceptions( Exception $e ) {
     if ( $e instanceof Slim_Exception_Stop === false ) {
         Slim_Log::error($e);
         if ( self::config('debug') === true ) {
             self::halt(500, self::generateErrorMarkup($e->getMessage(), $e->getFile(), $e->getLine(), $e->getTraceAsString()));
         } else {
             self::error();
         }
     }
     die();
 }
コード例 #2
0
ファイル: LogTest.php プロジェクト: inscriptionweb/lebonmail
 /**
  * Test Log adapter methods if no logger set
  *
  * Pre-conditions
  * Log instantiated without associated Logger
  *
  * Post-conditions:
  * All Log adapter methods return false
  */
 public function testLoggerMethodsIfNoLogger()
 {
     $log = new Slim_Log();
     $this->assertFalse($log->debug('Test'));
     $this->assertFalse($log->info('Test'));
     $this->assertFalse($log->warn('Test'));
     $this->assertFalse($log->error('Test'));
     $this->assertFalse($log->fatal('Test'));
 }
コード例 #3
0
ファイル: LogTest.php プロジェクト: nerdfiles/slim_bp
 public function testLogErrorExcludedByLevel()
 {
     $log = new Slim_Log(new MyWriter());
     $log->setLevel(0);
     $this->assertFalse($log->error('Error'));
 }
コード例 #4
0
ファイル: LogTest.php プロジェクト: alanvivona/scawTP
 /**
  * Test Log adapter methods if no logger set
  *
  * Pre-conditions
  * Logger not set
  *
  * Post-conditions:
  * All calls to adapter return false
  */
 public function testLoggerMethodsIfNoLogger()
 {
     Slim_Log::setLogger(null);
     $this->assertFalse(Slim_Log::debug('Test'));
     $this->assertFalse(Slim_Log::info('Test'));
     $this->assertFalse(Slim_Log::warn('Test'));
     $this->assertFalse(Slim_Log::error('Test'));
     $this->assertFalse(Slim_Log::fatal('Test'));
 }