Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Logger Class Reference
Inheritance diagram for Logger:
Bare FrontendInterface

Public Member Functions

 __construct (FrontendInterface $frontend, LoggerHandler $logger)
 
 remove ($identifier)
 
 clean ($mode=\Zend_Cache::CLEANING_MODE_ALL, array $tags=[])
 
 log ($args)
 
- Public Member Functions inherited from Bare
 __construct (\Magento\Framework\Cache\FrontendInterface $frontend)
 
 test ($identifier)
 
 load ($identifier)
 
 save ($data, $identifier, array $tags=[], $lifeTime=null)
 
 remove ($identifier)
 
 clean ($mode=\Zend_Cache::CLEANING_MODE_ALL, array $tags=[])
 
 getBackend ()
 
 getLowLevelFrontend ()
 

Additional Inherited Members

- Protected Member Functions inherited from Bare
 setFrontend (\Magento\Framework\Cache\FrontendInterface $frontend)
 
 _getFrontend ()
 

Detailed Description

Cache frontend decorator that logs cache invalidation actions

Definition at line 15 of file Logger.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( FrontendInterface  $frontend,
LoggerHandler  $logger 
)
Parameters
FrontendInterface$frontend
LoggerHandler$logger

Definition at line 26 of file Logger.php.

27  {
28  parent::__construct($frontend);
29  $this->logger = $logger;
30  }

Member Function Documentation

◆ clean()

clean (   $mode = \Zend_Cache::CLEANING_MODE_ALL,
array  $tags = [] 
)

{Clean cache records matching specified tags

Parameters
string$mode
array$tags
Returns
bool @api
}

Implements FrontendInterface.

Definition at line 45 of file Logger.php.

46  {
47  $result = parent::clean($mode, $tags, $mode);
48  $this->log(compact('tags', 'mode'));
49  return $result;
50  }
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
Definition: grid.phtml:15

◆ log()

log (   $args)
Parameters
mixed$args
Returns
void

Definition at line 56 of file Logger.php.

57  {
58  $this->logger->execute($args);
59  }

◆ remove()

remove (   $identifier)

{Remove cache record by its unique identifier

Parameters
string$identifier
Returns
bool @api
}

Implements FrontendInterface.

Definition at line 35 of file Logger.php.

36  {
37  $result = parent::remove($identifier);
38  $this->log(compact('identifier'));
39  return $result;
40  }

The documentation for this class was generated from the following file: