Пример #1
0
 public function testLog()
 {
     Log::setLevel('ALL');
     Conf::set('log_delayed', true);
     Conf::set('log_handlers', array('\\photon\\log\\NullBackend'));
     $message = 'dummy message';
     $i = 0;
     Log::plog($message);
     $i++;
     $this->assertEquals($i, count(Log::$stack));
     Log::debug($message);
     $i++;
     $this->assertEquals($i, count(Log::$stack));
     Log::info($message);
     $i++;
     $this->assertEquals($i, count(Log::$stack));
     Log::perf($message);
     $i++;
     $this->assertEquals($i, count(Log::$stack));
     Log::event($message);
     $i++;
     $this->assertEquals($i, count(Log::$stack));
     Log::warn($message);
     $i++;
     $this->assertEquals($i, count(Log::$stack));
     Log::error($message);
     $i++;
     $this->assertEquals($i, count(Log::$stack));
     Log::fatal($message);
     $i++;
     $this->assertEquals($i, count(Log::$stack));
     FileBackend::$return = true;
     Log::flush();
     $this->assertEquals(0, count(Log::$stack));
     FileBackend::$return = false;
     Log::flush();
     $this->assertEquals(0, count(Log::$stack));
     Log::flush();
     $this->assertEquals(0, count(Log::$stack));
     Conf::set('log_delayed', false);
     Log::info($message);
     $this->assertEquals(0, count(Log::$stack));
 }
Пример #2
0
 public function testLog()
 {
     Log::setLevel('ALL');
     Log::info('PHPUnit is running');
     Log::info('All looks good !');
 }
Пример #3
0
<?php

// Set the initial log level
\photon\log\Log::setLevel('INFO');
return array('debug' => true, 'secret_key' => 'A very long secret key to sign cookie', 'base_urls' => '', 'urls' => include 'urls.php', 'template_folders' => array(__DIR__ . '/HelloWorld/templates'), 'middleware_classes' => array('photon\\middleware\\Gzip'));