Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 2
0
 /**
  * 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);
 }
Ejemplo n.º 3
0
 /**
  * @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__);
 }
Ejemplo n.º 4
0
 public function setEnvironmentVariable($environmentVariable = 'APP_ENV')
 {
     HelperTool::setEnvironmentVariable($environmentVariable);
     ExceptionHelper::setEnvironmentVariable($environmentVariable);
 }
Ejemplo n.º 5
0
 /**
  * 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);
 }
Ejemplo n.º 6
0
 /**
  * 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);
 }