示例#1
0
 public function testLoggingMethods()
 {
     Logger::emergency("Test logger!");
     Logger::alert("Test logger!");
     Logger::critical("Test logger!");
     Logger::error("Test logger!");
     Logger::warning("Test logger!");
     Logger::notice("Test logger!");
     Logger::info("Test logger!");
     Logger::debug("Test logger!");
     $this->assertStringEqualsFile(vfsStream::url("logs/file.log"), $this->log);
 }
示例#2
0
 private static function runJob($job)
 {
     try {
         Logger::notice("Job #" . self::$jobId . " started.");
         $job->setup();
         $job->go();
         $job->tearDown();
         Logger::notice("Job #" . self::$jobId . " finished.");
     } catch (\Exception $e) {
         self::logException($e, "Job #" . self::$jobId . " Exception");
         Logger::alert("Job #" . self::$jobId . " died.");
     }
 }
示例#3
0
 /**
  *
  * @return ajumamoro\Store
  */
 public static function getInstance()
 {
     $delay = 30;
     while (self::$instance === null) {
         try {
             self::$instance = self::factory();
             self::$instance->init();
         } catch (exceptions\BrokerConnectionException $e) {
             Logger::alert("{$e->getMessage()}. Retrying in {$delay} seconds.");
             sleep($delay);
             $delay *= 2;
         }
     }
     Logger::info("Succesfully connected to broker");
     return self::$instance;
 }