echo "<table> <tr><td>" . translate("Client") . ":</td><td>" . $info['REQUEST_DETAILS']['REMOTE_ADDR'] . "</td></tr> <tr><td>" . translate("User Agent") . ":</td><td>" . $info['REQUEST_DETAILS']['HTTP_USER_AGENT'] . "</td></tr> </table>"; echo "<pre>"; print_r($info['REQUEST_DETAILS']); echo "</pre>"; } if ($info['object']) { echo "<h4>" . translate("Affected Object: ") . "</h4>"; echo "<pre>"; print_r(LOGGER::DecodeObject($info['object'])); echo "</pre>"; } if ($info['result']) { echo "<h4>" . translate("Result: ") . "</h4>"; if (preg_match("/(getimage|getlogo)/", $info['source'])) { $data = pack("H*", $info['result']); $image = new Imagick(); if ($image) { $image->readImageBlob($data); $format = $image->getImageFormat(); $geometry = $image->getImageGeometry(); $size = $image->getImageSize(); echo translate("Image Information: %s, %dx%d, %s", $format, $geometry['width'], $geometry['height'], dsPrintSize($size)) . "<br/>"; # print_r($image->identifyImage());
/** * Closes the logger output, performing any cleanup. * All nested loggers are closed automatically. */ public function close() { $this->_close(); if (isset($this->logger)) { $this->logger->close(); } }
/** * Called immediately after creating a logger. * Override this function to customize initialization. By default, all errors * and warnings are enabled, as well as any messages issued on the default * channel (which are messages you are likely to emit with the when calling * {@link log_message()}. * @see _make_logger() * @param LOGGER $logger * @access private */ protected function _init_logger($env, $logger) { $logger->set_enabled(Msg_type_error | Msg_type_warning); $logger->set_channel_enabled(Msg_channel_default, Msg_type_all); }
/** * Set logger level. * DEBUG => 100 * INFO => 200 * WARNING => 300 * ERROR => 400 * CRITICAL => 500 * ALERT => 550 * * @param int $level Logger level. * @param string $file Optional file. */ public function setLogConfig($level, $file = NULL) { $levels = array(LOGGER::DEBUG, LOGGER::INFO, LOGGER::WARNING, LOGGER::ERROR, LOGGER::CRITICAL, LOGGER::ALERT); $this->setLogFile($file); if (!in_array($level, $levels)) { $level = Logger::ALERT; } $streamhandler = new StreamHandler($this->logfile, $level); if (isset($this->logger_level)) { $this->logger->popHandler(); } else { $this->logger = new Logger('Storify'); } $this->logger->pushHandler($streamhandler); $this->logger_level = $level; $this->logger->AddInfo("Setting logfile to: " . $this->logfile); $this->logger->AddInfo("Setting log level to: " . $this->logger_level . "(" . LOGGER::getLevelName($this->logger_level) . ")"); }
static function GetLogFile($date) { return sprintf("%s/%s.log", LOGGER::GetLogDir(), date("Ymd", $date)); }