Logger.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Ui\Block;
  7. use Magento\Framework\View\Element\Template;
  8. use Magento\Ui\Model\Config;
  9. /**
  10. * Logger block
  11. *
  12. * @api
  13. * @since 100.0.2
  14. */
  15. class Logger extends Template
  16. {
  17. /**
  18. * @var Config
  19. */
  20. protected $config;
  21. /**
  22. * @param Template\Context $context
  23. * @param Config $config
  24. * @param array $data
  25. */
  26. public function __construct(
  27. Template\Context $context,
  28. Config $config,
  29. array $data = []
  30. ) {
  31. parent::__construct($context, $data);
  32. $this->config = $config;
  33. }
  34. /**
  35. * Is session storage logging enabled
  36. *
  37. * @return bool
  38. */
  39. public function isLoggingEnabled()
  40. {
  41. return $this->config->isLoggingEnabled();
  42. }
  43. /**
  44. * Get session storage key
  45. *
  46. * @return string
  47. */
  48. public function getSessionStorageKey()
  49. {
  50. return $this->config->getSessionStorageKey();
  51. }
  52. }