Esempio n. 1
0
 /** Logs the data into specific logs.
  * This function logs the specified data into the right logfile, adding the date and a line return.
  * 
  * \param $log The log to write to.
  * \param $text The text to write in the log.
  * \param $server The server on which the data will be logged. Defaults to the current server.
  * 
  * \return TRUE if the text has been correctly logged, FALSE otherwise.
  */
 public function log($log, $text, $server = NULL)
 {
     if ($server === NULL) {
         $server = Server::getName();
     }
     if (!isset($this->_logFiles[$server])) {
         return FALSE;
     }
     if (!isset($this->_logFiles[$server][$log])) {
         return FALSE;
     }
     $ret = fputs($this->_logFiles[$server][$log], date(Locales::getDateTimeFormat()) . ' - ' . $text . "\n");
     return $ret !== FALSE;
 }