You are here

private function InstapageCmsPluginAjaxController::getLog in Instapage plugin 8.3

Same name and namespace in other branches
  1. 7.3 core/InstapageCmsPluginAjaxController.php \InstapageCmsPluginAjaxController::getLog()

Gets the debug log stored in the DB.

1 call to InstapageCmsPluginAjaxController::getLog()
InstapageCmsPluginAjaxController::doAction in core/InstapageCmsPluginAjaxController.php
Executes an action set in the request.

File

core/InstapageCmsPluginAjaxController.php, line 212

Class

InstapageCmsPluginAjaxController
Main controller for AJAX actions. Results are returned as encoded JSON objects. Data for actions are stored in $_POST['data'] table.

Code

private function getLog() {
  $log = InstapageCmsPluginDebugLogModel::getInstance();
  $sitenameSanitized = InstapageCmsPluginConnector::getSitename(true);
  try {
    $data = $log
      ->getLogHTML();
    echo json_encode((object) array(
      'status' => 'OK',
      'data' => $data,
      'sitename' => $sitenameSanitized,
    ));
  } catch (Exception $e) {
    echo InstapageCmsPluginHelper::formatJsonMessage($e
      ->getMessage(), 'ERROR');
  }
}