Пример #1
0
<?php

require '../lib/Analog.php';
Analog::handler(Analog\Handler\ChromeLogger::init());
// debug-level message
Analog::debug($_SERVER);
// an info message
Analog::info('An error message');
// a warning message
Analog::warning('Turn back before it\'s too late');
// an error with no file/line #'s
Analog::log('Another error message');
Пример #2
0
 function test_aliases()
 {
     self::$log = '';
     Analog::urgent('Testing');
     $this->assertStringMatchesFormat("localhost, %d-%d-%d %d:%d:%d, 0, Testing\n", self::$log);
     self::$log = '';
     Analog::alert('Testing');
     $this->assertStringMatchesFormat("localhost, %d-%d-%d %d:%d:%d, 1, Testing\n", self::$log);
     self::$log = '';
     Analog::error('Testing');
     $this->assertStringMatchesFormat("localhost, %d-%d-%d %d:%d:%d, 3, Testing\n", self::$log);
     self::$log = '';
     Analog::warning('Testing');
     $this->assertStringMatchesFormat("localhost, %d-%d-%d %d:%d:%d, 4, Testing\n", self::$log);
     self::$log = '';
     Analog::notice('Testing');
     $this->assertStringMatchesFormat("localhost, %d-%d-%d %d:%d:%d, 5, Testing\n", self::$log);
     self::$log = '';
     Analog::info('Testing');
     $this->assertStringMatchesFormat("localhost, %d-%d-%d %d:%d:%d, 6, Testing\n", self::$log);
     self::$log = '';
     Analog::debug('Testing');
     $this->assertStringMatchesFormat("localhost, %d-%d-%d %d:%d:%d, 7, Testing\n", self::$log);
     self::$log = '';
 }