Beispiel #1
0
 public function logIt(LogEntry $entry)
 {
     $type = $entry->getType();
     $message = $entry->getMessage();
     $userID = $entry->getUserID();
     $db = Database::getInstance();
     if (!$db->isConnected()) {
         return false;
     }
     $message = $db->escapeString($message);
     $results = $db->insertData('systemLog', 'message, type, userID', '\'' . $message . '\', \'' . $type . '\', \'' . $userID . '\'');
     if (!$results) {
         return false;
     }
     return true;
 }
Beispiel #2
0
 /**
  * @covers Phossa\Logger\LogEntry::getMessage
  */
 public function testGetMessage()
 {
     $this->assertEquals('test error', $this->object->getMessage());
 }