Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
logger.phtml
Go to the documentation of this file.
1 <?php
6 // @codingStandardsIgnoreFile
7 ?>
8 <?php ?>
9 <?php if ($block->isLoggingEnabled()): ?>
10  <script>
11  window.onerror = function(msg, url, line) {
12  var key = "<?= /* @escapeNotVerified */ $block->getSessionStorageKey() ?>";
13  var errors = {};
14  if (sessionStorage.getItem(key)) {
15  errors = JSON.parse(sessionStorage.getItem(key));
16  }
17  if (!(window.location.href in errors)) {
18  errors[window.location.href] = [];
19  }
20  errors[window.location.href].push("error: \'" + msg + "\' " + "file: " + url + " " + "line: " + line);
21  sessionStorage.setItem(key, JSON.stringify(errors));
22  };
23  </script>
24 <?php endif; ?>
endif
Definition: logger.phtml:24
$block
Definition: block.php:8