public function test_logger() { $log = Flancer32_PayPalApi_Logger::getLogger(__CLASS__); $this->assertTrue($log instanceof Flancer32_PayPalApi_Logger); $log->trace('trace level message'); $log->debug('debug level message'); $log->info('info level message'); $log->warn('warn level message'); $log->error('error level message'); $log->fatal('fatal level message'); }
function __construct($name) { /** * switch off/on error reporting to prevent messages like * "ERR (3): Warning: include(Praxigento\Log\Logger.php): failed to open stream: No such file or directory" * in case of Praxigento_Log module is not used. */ $level = error_reporting(0); self::$_isLog4phpUsed = class_exists('Praxigento_Log_Logger', true); error_reporting($level); if (self::$_isLog4phpUsed) { $this->_loggerLog4php = Praxigento_Log_Logger::getLogger($name); } else { $this->_name = is_object($name) ? get_class($name) : (string) $name; } }