Beispiel #1
0
 protected function action()
 {
     // event should exists
     Log::getByName($this->GetParam('event'));
     Record::add($this->GetParam('event'), $this->GetParam('short'), $this->GetParam('full'));
     return true;
 }
Beispiel #2
0
 protected function action()
 {
     $log = Log::getByName($this->getParam('name'));
     $log->critical->setValue(intval($this->getParam('priority')));
     $log->update();
     \CMSLog::addMessage(__CLASS__, sprintf('Log "%s" priority changed to - "%d"', $this->getParam('name'), $this->getParam('priority')));
     return true;
 }
Beispiel #3
0
 protected function action()
 {
     $log = Log::getByName($this->getParam('name'));
     $log->obj_enable_logging->setValue(intval($this->getParam('enable_logging')));
     $log->update();
     \CMSLog::addMessage(__CLASS__, sprintf('Log `%s` logging updated. Logging set to - "%d" ', $this->getParam('name'), $this->getParam('enable_logging')));
     return true;
 }
Beispiel #4
0
 public function testSetValue()
 {
     $api = new SetupPriority();
     $api->setParamsData(array('name' => 'Log1', 'priority' => 1));
     //
     $api->exec();
     //
     $log = Log::getByName('Log1');
     $this->assertEquals(true, $log->critical->getValue());
 }
Beispiel #5
0
 public function testRecordNotAddedInEnableLoggingDisabled()
 {
     $initial = DBSimple::getRowsCount(Record::tableName);
     //
     $log = Log::getByName('Log1');
     $log->setupLogging(false);
     //
     $result = Record::add('Log1', '1', '2');
     $this->assertTrue(empty($result));
     //
     $result = DBSimple::getRowsCount(Record::tableName);
     $this->AssertEquals($initial, $result);
 }