protected function action() { // event should exists Log::getByName($this->GetParam('event')); Record::add($this->GetParam('event'), $this->GetParam('short'), $this->GetParam('full')); return true; }
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; }
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; }
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()); }
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); }