/** * Prepare config and logger * * @param string $message Message of this exception * @param string $file File path and name where the exception has taken place * @param int $lineNo Line number where the exception has taken place */ public function __construct($message, $file, $lineNo) { parent::__construct($message); $logger = Helper::getLogger(Logger::ALERT); $logger->alert('\'' . $message . '\' in file \'' . $file . '\', at line ' . $lineNo); }
/** * Prepare config and logger * * @param string $message Message of this exception * @param string $file File path and name where the exception has taken place * @param int $lineNo Line number where the exception has taken place */ public function __construct($message, $file, $lineNo) { parent::__construct($message); $logger = Helper::getLogger(Logger::WARNING); $logger->warning('\'' . $message . '\' in file \'' . $file . '\', at line ' . $lineNo); }
/** * @expectedException \Tasker\Exception\UnExpectedException */ public function testThrowAnException() { ExceptionHelper::setConfigPath(__DIR__ . '/config.php'); ExceptionHelper::setEnvironmentVariable('APP_ENV'); throw new UnExpectedException('this is a test', __FILE__, __LINE__); }
public function setEnvironmentVariable($environmentVariable = 'APP_ENV') { HelperTool::setEnvironmentVariable($environmentVariable); ExceptionHelper::setEnvironmentVariable($environmentVariable); }
/** * Prepare config and logger * * @param string $message Message of this exception * @param string $file File path and name where the exception has taken place * @param int $lineNo Line number where the exception has taken place */ public function __construct($message, $file, $lineNo) { parent::__construct($message); $logger = Helper::getLogger(Logger::EMERGENCY); $logger->emergency('\'' . $message . '\' in file \'' . $file . '\', at line ' . $lineNo); }
/** * Prepare config and logger * * @param string $message Message of this exception * @param string $file File path and name where the exception has taken place * @param int $lineNo Line number where the exception has taken place */ public function __construct($message, $file, $lineNo) { parent::__construct($message); $logger = Helper::getLogger(Logger::CRITICAL); $logger->critical('\'' . $message . '\' in file \'' . $file . '\', at line ' . $lineNo); }