public function appendMessage($level, $message) { if (!is_int($level)) { throw new osapiLoggerException($level . " is not a number."); } if ($level > osapiLogger::NONE || $level < osapiLogger::ALL) { throw new osapiLoggerException("Level should be between ALL(0) " . "and NONE(6)."); } echo parent::prettyPrint($level, $message); }
public function appendMessage($level, $message) { if (!is_int($level)) { throw new osapiLoggerException($level . " is not a number."); } if ($level > osapiLogger::NONE || $level < osapiLogger::ALL) { throw new osapiLoggerException("Level should be between ALL(0) " . "and NONE(6)."); } if ($this->isLocked()) { // Some other process is writing to this file too, wait until it's // done to prevent hickups. $this->waitForLock(); } $this->createLock(); $fpt = fopen($this->logFile, "a+"); if ($fpt != NULL) { fputs($fpt, parent::prettyPrint($level, $message)); fclose($fpt); } $this->removeLock(); }